diff options
author | ThibG <thib@sitedethib.com> | 2020-06-02 13:57:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-02 13:57:21 +0200 |
commit | 9b7e3b4774d47c184aa759364d41f40e0cdfa210 (patch) | |
tree | 3a6c6a63475f9251e74b299959c59714adc31f04 /lib/tasks | |
parent | f96a891853e73454bacdb25922d403834878f8c4 (diff) |
Fix mastodon:setup not running properly when some environment variables are set (#13928)
When using one of the docker-compose containers, mastodon:setup will use the existing .env.production rather than the generated one during the setup steps. This is because dotenv does not overwrite env variables that are alreayd defined, and the docker-compose.yml file loads the environment variables from .env.production.
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/mastodon.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index a873335d4..a41080a63 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -367,7 +367,7 @@ namespace :mastodon do prompt.say 'Running `RAILS_ENV=production rails db:setup` ...' prompt.say "\n\n" - if cmd.run!({ RAILS_ENV: 'production', SAFETY_ASSURED: 1 }, :rails, 'db:setup').failure? + if cmd.run!(env.merge({ RAILS_ENV: 'production', SAFETY_ASSURED: 1 }), :rails, 'db:setup').failure? prompt.error 'That failed! Perhaps your configuration is not right' else prompt.ok 'Done!' @@ -382,7 +382,7 @@ namespace :mastodon do prompt.say 'Running `RAILS_ENV=production rails assets:precompile` ...' prompt.say "\n\n" - if cmd.run!({ RAILS_ENV: 'production' }, :rails, 'assets:precompile').failure? + if cmd.run!(env.merge({ RAILS_ENV: 'production' }), :rails, 'assets:precompile').failure? prompt.error 'That failed! Maybe you need swap space?' else prompt.say 'Done!' |