Retry assets:precompile up to three times

`assets:precompile` may fail because of `Zlib::BufError`. This might be
a sprockets/Zlib bug.

See https://github.com/ruby/zlib/issues/49
This commit is contained in:
Bianca Nenciu 2025-02-17 19:41:51 +02:00
parent 3715498fc1
commit 260959faa9
No known key found for this signature in database
GPG Key ID: 07E83B117A6B844D
1 changed files with 4 additions and 1 deletions

View File

@ -221,7 +221,10 @@ run:
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'
# `assets:precompile` may fail because of `Zlib::BufError`. This might be a sprockets/Zlib bug: https://github.com/ruby/zlib/issues/49
- su discourse -c 'n=0; until [ "$n" -ge 3 ]; do SKIP_EMBER_CLI_COMPILE=1 bundle exec rake assets:precompile && break; n=$((n+1)); done'
- replace:
tag: precompile
filename: /etc/service/unicorn/run