Skip to content

Commit

Permalink
removed redundant RAILS_MASTER_KEY handling in deploy.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Apr 20, 2021
1 parent 65d1afb commit 3a16a36
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,9 @@

namespace :deploy do
before :compile_assets, "deploy:retrieve_credentials"
before :compile_assets, "deploy:retrieve_master_key"
after :deploy, "git:version"
after :deploy, "cleanup:remove_example_configs"

desc 'Retrieve master.key contents from SSM ParameterStore'
task :retrieve_master_key do
on roles(:app), wait: 1 do
if ENV.has_key?('SSM_ROOT_PATH')
begin
ssm = Uc3Ssm::ConfigResolver.new
master_key = ssm.parameter_for_key('master_key')
ENV['RAILS_MASTER_KEY'] = master_key.chomp unless master_key.nil? or master_key.empty?
rescue => e
ActiveSupport::Logger.new($stdout).warn("Could not retrieve master_key from SSM Parameter Store: #{e.full_message}")
end
end
end
end

desc 'Retrieve encrypted crendtials file from SSM ParameterStore'
task :retrieve_credentials do
on roles(:app), wait: 1 do
Expand Down

0 comments on commit 3a16a36

Please sign in to comment.