Closed leomao10 closed 5 years ago
Sorry, I missed this. By default, the build process for Ruby on the App Engine flexible environment ignores failures of asset precompilation, on the theory that not all applications actually use the asset pipeline (e.g. running asset precompilation could just fail by design) and we don't want to block those apps from deploying. The runtime does this by setting the default build script to bundle exec rake assets:precompile || true
.
If you want failures to cause the deployment to error out, you can override that build script and remove the || true
. Do this by adding this to your app.yaml
:
runtime_config:
build:
- bundle exec rake assets:precompile
(Note that you can do further customizations of the build process in the same way. This capability is not in the official documentation, but it does work.)
No worries, and thank you very much for the response @dazuma , It is actually really helpful. Will close this issue now as you already provide the solution 👍
Just want to find out how we can stop the docker build process when
rake assets:precompile
raise error.During our GCP deploy, we found that some of the assets were missing, and after a while of digging, I found that it is because it failed during
rake assets:precompile
. However, when we check the cloud build, it said it is passed. Here is the log:Wondering if it is possible to fail the docker build when asset precompile is failed so that we can pick it up during deployment, not after deployment and switch traffic to the problematic build?