diff --git a/config/deploy.rb b/config/deploy.rb index 1112257cb..7a10e80ed 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -136,9 +136,15 @@ task :smtp_ssl_and_delay_jobs_secrets do within current_path do with rails_env: fetch(:rails_env) do tasks_file_path = "lib/tasks/secrets.rake" + shared_secrets_path = "#{shared_path}/config/secrets.yml" unless test("[ -e #{current_path}/#{tasks_file_path} ]") begin + unless test("[ -w #{shared_secrets_path} ]") + execute "sudo chown `whoami` #{shared_secrets_path}" + execute "chmod u+w #{shared_secrets_path}" + end + execute "cp #{release_path}/#{tasks_file_path} #{current_path}/#{tasks_file_path}" execute :rake, "secrets:smtp_ssl_and_delay_jobs"