Skip to content

Commit

Permalink
ENG-5543 - Fixes unbound variable issue when variable is not provided…
Browse files Browse the repository at this point in the history
… on environment
  • Loading branch information
w-caffiero-entando committed Feb 26, 2025
1 parent f176c12 commit bb60320
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ else
ENV_KEYCLOAK_JSON="${KEYCLOAK_JSON}"
fi
ENV_JSON='{'
ENV_JSON+='"DOMAIN":"'"$ENV_DOMAIN"'", '
ENV_JSON+='"DOMAIN_CM":"'"$DOMAIN_CM"'", '
ENV_JSON+='"KEYCLOAK_JSON":"'"$ENV_KEYCLOAK_JSON"'", '
ENV_JSON+='"ENTANDO_VIRTUAL_CONTEXTS":"'"$ENTANDO_VIRTUAL_CONTEXTS"'"'
[ -n "$DOMAIN" ] && ENV_JSON+='"DOMAIN":"'"$ENV_DOMAIN"'", '
[ -n "$DOMAIN_CM" ] && ENV_JSON+='"DOMAIN_CM":"'"$DOMAIN_CM"'", '
[ -n "$KEYCLOAK_JSON" ] && ENV_JSON+='"KEYCLOAK_JSON":"'"$ENV_KEYCLOAK_JSON"'", '
[ -n "$ENTANDO_VIRTUAL_CONTEXTS" ] && ENV_JSON+='"ENTANDO_VIRTUAL_CONTEXTS":"'"$ENTANDO_VIRTUAL_CONTEXTS"'"'
ENV_JSON+='}'

ESCAPED_ENV_JSON=$(echo $ENV_JSON | sed 's/\"/\\\"/g' | sed 's/\//\\\//g' | tr -d '\n' | tr -d '[[:blank:]]')
Expand Down

0 comments on commit bb60320

Please sign in to comment.