From d106a12749f54df7528f45ac05ae709559b096a4 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 23 May 2022 16:59:52 +0200 Subject: [PATCH] (setup) Detect assets compilation issues and interrupt the script --- CHANGELOG.md | 1 + setup/setup.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed0b81e1..ef5f13425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Disable to clicking outside or pressing escape to close sign up modal - Ability to disable colorize logging (#345) +- Detect assets compilation issue during the initial setup - Fix a bug: when machines module disabled, Associated machines is still shown in trainings list - Fix a bug: script mount-proof-of-identity-files unable to modify docker-compose.yml - Fix a bug: Event reservation calendar encoding in mail diff --git a/setup/setup.sh b/setup/setup.sh index e37db3066..226ed8536 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -380,7 +380,9 @@ setup_assets_and_databases() cd "$FABMANAGER_PATH" && docker-compose run --rm -e ADMIN_EMAIL="$EMAIL" -e ADMIN_PASSWORD="$PASSWORD" "$SERVICE" bundle exec rake db:seed # seed the database # now build the assets - cd "$FABMANAGER_PATH" && docker-compose run --rm "$SERVICE" bundle exec rake assets:precompile + if ! docker-compose -f "$FABMANAGER_PATH/docker-compose.yml" run --rm "$SERVICE" bundle exec rake assets:precompile; then + echo -e "\e[91m[ ❌ ] someting went wrong while compiling the assets, exiting...\e[39m" && exit 1 + fi # and prepare elasticsearch cd "$FABMANAGER_PATH" && docker-compose run --rm "$SERVICE" bundle exec rake fablab:es:build_stats