diff --git a/CHANGELOG.md b/CHANGELOG.md index 52bb0ff4c..47930ad5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Footprints are now generated in a more reproductible way - Task to reset the stripe payment methods in test mode - Validate on server side the reservation of slots restricted to subscribers +− Unified and documented upgrade exit codes - Fix a bug: build status badge is not working - Fix a bug: unable to set date formats during installation - Fix a bug: unable to cancel the upgrade before it begins diff --git a/setup/upgrade.sh b/setup/upgrade.sh index ac3cb36d1..db0e0ce62 100644 --- a/setup/upgrade.sh +++ b/setup/upgrade.sh @@ -125,7 +125,7 @@ compile_assets() PG_ID=$(docker-compose ps -q postgres) if [[ "$PG_ID" = "" ]]; then printf "\e[91m[ ❌ ] PostgreSQL container is not running, unable to compile the assets\e[39m\nExiting..." - exit 1 + exit 4 fi PG_NET_ID=$(docker inspect "$PG_ID" -f "{{json .NetworkSettings.Networks }}" | jq -r '.[] .NetworkID') clean_env_file @@ -147,7 +147,7 @@ upgrade() add_environments if ! docker-compose pull "$SERVICE"; then printf "\e[91m[ ❌ ] An error occurred, detected service name: %s\e[39m\nExiting..." "$SERVICE" - exit 1 + exit 4 fi BRANCH='master' if yq eval '.services.*.image | select(. == "sleede/fab-manager*")' docker-compose.yml | grep -q ':dev'; then BRANCH='dev'; fi @@ -207,7 +207,13 @@ Options: -p Run the preprocessing command (TODO DEPLOY) -c Provides additional upgrade command, run in the context of the app (TODO DEPLOY) -s Executes a remote script (TODO DEPOY) - -e Adds the environment variable to config/env\n" "$(basename "$0")" 1>&2 + -e Adds the environment variable to config/env\n" "$(basename "$0") +Return codes: + 0 Upgrade terminated successfully + 1 Configuration required + 2 Aborted by user + 3 Version not supported + 4 Unexpected error" 1>&2 exit 1 }