This commit is contained in:
Yhael S
2023-10-20 00:57:28 -05:00
parent c3f70d3a99
commit 284dc69588
3 changed files with 31 additions and 13 deletions

View File

@@ -14,6 +14,23 @@ while IFS='=' read -r key value || [[ -n $key ]]; do
eval "$key=\"$value\"" eval "$key=\"$value\""
done < .env done < .env
# Check the USE_REDIS variable to decide whether to copy Redis directories
if [[ $USE_REDIS == "true" ]]; then
LOAD+=",base_attachment_object_storage"
LOAD+=",session_redis"
fi
# Check the USE_S3 variable to decide whether to copy S3 directories
if [[ $USE_S3 == "true" ]]; then
LOAD+=",attachment_s3"
fi
# Check if the repository directory exists and Sentry is to be used
if [[ $USE_SENTRY == "true" ]]; then
LOAD+=",sentry"
fi
case "$1" in case "$1" in
-- | odoo) -- | odoo)
shift shift

View File

@@ -27,7 +27,8 @@ fi
# Check the USE_S3 variable to decide whether to copy S3 directories # Check the USE_S3 variable to decide whether to copy S3 directories
if [[ $USE_S3 == "true" ]]; then if [[ $USE_S3 == "true" ]]; then
LOAD+=",base_attachment_object_storage,attachment_s3" LOAD+=",base_attachment_object_storage"
LOAD+=",attachment_s3"
fi fi
# Check if the repository directory exists and Sentry is to be used # Check if the repository directory exists and Sentry is to be used
@@ -35,8 +36,6 @@ if [[ $USE_SENTRY == "true" ]]; then
LOAD+=",sentry" LOAD+=",sentry"
fi fi
echo "Loading addons: $LOAD"
# Copy the example conf to the destination to start replacing the variables # Copy the example conf to the destination to start replacing the variables
cp "$TEMPLATE_CONF" "$ODOO_RC" cp "$TEMPLATE_CONF" "$ODOO_RC"

View File

@@ -2,21 +2,23 @@
set -e set -e
# Always use base_attachment_object_storage # Check if the repository directory exists and either Redis or S3 is to be used
git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; if [[ ${USE_REDIS} == "true" || ${USE_S3} == "true" ]]; then
cp -r odoo-cloud-platform/base_attachment_object_storage $THIRD_PARTY_ADDONS/base_attachment_object_storage git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags;
fi
if [[ $USE_REDIS == "true" ]]; then if [[ ${USE_REDIS} == "true" ]]; then
cp -r odoo-cloud-platform/session_redis $THIRD_PARTY_ADDONS/session_redis cp -r odoo-cloud-platform/session_redis ${THIRD_PARTY_ADDONS}/session_redis
fi fi
# Check the USE_S3 variable to decide whether to copy S3 directories # Check the USE_S3 variable to decide whether to copy S3 directories
if [[ $USE_S3 == "true" ]]; then if [[ ${USE_S3} == "true" ]]; then
cp -r odoo-cloud-platform/attachment_s3 $THIRD_PARTY_ADDONS/attachment_s3 cp -r odoo-cloud-platform/base_attachment_object_storage ${THIRD_PARTY_ADDONS}/base_attachment_object_storage
cp -r odoo-cloud-platform/attachment_s3 ${THIRD_PARTY_ADDONS}/attachment_s3
fi fi
# Check if the repository directory exists and Sentry is to be used # Check if the repository directory exists and Sentry is to be used
if [[ $USE_SENTRY == "true" ]]; then if [[ ${USE_SENTRY} == "true" ]]; then
git clone https://github.com/odoocker/server-tools.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; git clone https://github.com/odoocker/server-tools.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags;
cp -r server-tools/sentry $THIRD_PARTY_ADDONS/sentry cp -r server-tools/sentry ${THIRD_PARTY_ADDONS}/sentry
fi fi