From 56458bd222030da41e4bd23470d326c27ccb9aa9 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Sun, 6 Oct 2024 07:45:44 -0700 Subject: [PATCH] DEV: re-split build vs compile Allow for assets to be precompiled fully in a build image. The only remaining things for configure is update themes, maxmind download, and css compiling. --- templates/web.template.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index 81bc171..d4d8f29 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -62,8 +62,8 @@ run: PRECOMPILE_ON_BOOT=1 fi if [ -f /usr/local/bin/create_db ] && [ "$CREATE_DB_ON_BOOT" = "1" ]; then /usr/local/bin/create_db; 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 su discourse -c 'bundle exec rake maxminddb:refresh assets:precompile:css' || 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: @@ -216,13 +216,13 @@ run: tag: build hook: assets_precompile_build cmd: - - su discourse -c 'bundle exec rake assets:precompile:build' + - su discourse -c 'SKIP_DB_AND_REDIS=1 bundle exec rake assets:precompile' - exec: cd: $home tag: precompile hook: assets_precompile cmd: - - su discourse -c 'SKIP_EMBER_CLI_COMPILE=1 bundle exec rake themes:update assets:precompile' + - su discourse -c 'bundle exec rake themes:update maxminddb:refresh assets:precompile:css' - replace: tag: precompile filename: /etc/service/unicorn/run