Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ update_yaml_if_env_exists() {
local env_var=$1
local yaml_path=$2

if [ ! -z "${!env_var}" ]; then
# Check if the environment variable is set (even if empty)
if [ -n "${!env_var+x}" ]; then
if [[ "${!env_var}" == "true" || "${!env_var}" == "false" ]]; then
yq eval "$yaml_path |= ${!env_var}" -i $CONFIG_PATH
elif [ -z "${!env_var}" ]; then
yq eval "$yaml_path |= null" -i $CONFIG_PATH
else
yq eval "$yaml_path |= \"${!env_var}\"" -i $CONFIG_PATH
fi
Expand Down Expand Up @@ -67,5 +70,12 @@ update_yaml_if_env_exists "CHECK_ORG_TABLE_SUBSCRIPTIONS_TASK_INTERVAL" '.APP.TA
# GOVERNANCE section
update_yaml_if_env_exists "GOVERNANCE_BODY_ID" '.GOVERNANCE.GOVERNANCE_BODY_ID'

# Print config file contents if DOCKER_DEBUG is true
if [ "${DOCKER_DEBUG}" = "true" ]; then
echo "=== CADT Config File Contents ==="
cat $CONFIG_PATH
echo "================================"
fi

# Execute the command passed to docker run
exec "$@"
Loading