Skip to content

Commit

Permalink
DEV: exit if migrate or precompile on boot fail
Browse files Browse the repository at this point in the history
No need to wait for create db on boot in unicorn, job will restart
  • Loading branch information
featheredtoast committed Sep 30, 2024
1 parent a7332d0 commit 15f595a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions templates/web.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ run:
if [[ -z "$PRECOMPILE_ON_BOOT" ]]; then
PRECOMPILE_ON_BOOT=1
fi
if [ -f /usr/local/bin/create_db ] && [ "$CREATE_DB_ON_BOOT" = "1" ]; then sleep 10; fi;
if [ "$MIGRATE_ON_BOOT" = "1" ]; then su discourse -c 'bundle exec rake db:migrate'; fi
if [ "$PRECOMPILE_ON_BOOT" = "1" ]; then SKIP_EMBER_CLI_COMPILE=1 su discourse -c 'bundle exec rake assets:precompile'; fi
if [ "$MIGRATE_ON_BOOT" = "1" ]; then su discourse -c 'bundle exec rake db:migrate' || exit 1; fi
if [ "$PRECOMPILE_ON_BOOT" = "1" ]; then SKIP_EMBER_CLI_COMPILE=1 su discourse -c 'bundle exec rake assets:precompile' || exit 1; fi
LD_PRELOAD=$RUBY_ALLOCATOR HOME=/home/discourse USER=discourse exec thpoff chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb
- file:
Expand Down

0 comments on commit 15f595a

Please sign in to comment.