Enable/disable delayed jobs in the secrets file

While this is not a secret and in theory should be in a file under
version control, currently the CONSUL installer disables delayed jobs by
default, meaning we were keeping two versions of the delayed jobs
configuration file, and some existing configurations have their settings
defined in a file in capistrano's `shared` folder.

So we're moving existing settings to the secrets file.
This commit is contained in:
Javi Martín
2019-11-02 21:58:28 +01:00
parent 6ecd9e59dc
commit a08d42d3f8
4 changed files with 14 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
namespace :secrets do
desc "Add SMTP and SSL settings to secrets.yml"
task smtp_and_ssl: :environment do
desc "Add SMTP, SSL and delay jobs settings to secrets.yml"
task smtp_ssl_and_delay_jobs: :environment do
current_settings = {
"mailer_delivery_method" => ActionMailer::Base.delivery_method.to_s,
"smtp_settings" => ActionMailer::Base.smtp_settings.stringify_keys,
"force_ssl" => Rails.application.config.force_ssl
"force_ssl" => Rails.application.config.force_ssl,
"delay_jobs" => Delayed::Worker.delay_jobs
}
settings_to_add = current_settings.select do |name, _|