![]() ![]() In GitLab add a CI/CD variable for your rails master key (mask the variable).RUN chmod +x /usr/bin/docker-entrypoint.sh ![]() run/secrets/auto-devops-build-secrets & RAILS_ENV=production bundle exec rails assets:precompile RUN -mount=type=secret,id=auto-devops-build-secrets. RUN bundle install -without development test RUN apt-get update & apt-get install -y nodejs mysql-client postgresql-client sqlite3 vim -no-install-recommends & rm -rf /var/lib/apt/lists/* # syntax = docker/dockerfile:experimental Ask your team for your master key and write it to config/master.key or put it in the ENV. Missing encryption key to decrypt file with. Rails assets:precompile doesn't depend on the existence of master key even when config.require_master_key = true Actual behavior I dockerize my Rails app and run rails assets:precompile with RAILS_ENV=production and let GitLab CI build the image, but it failed because master.key is not in the repo for security and I can't inject RAILS_MASTER_KEY during CI's build phase.ĭo we really need to check for the existence of master key during assets:precompile? Expected behavior ![]() $ RAILS_ENV=production rails assets:precompile $ cat config/environments/production.rb | grep config.require_master_key $ # Set config.require_master_key = true in production.rb ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |