Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- desc "upload certificate and key"
- task :upload_cert, :roles => :lb do
- set :ssl_passphrase, Proc.new { Capistrano::CLI.password_prompt('Certificate passphrase: ') }
- upload("config/deploy/#{stage}/nginx.crt", "/tmp/nginx-#{stage}.crt", :via => :scp, :roles => :lb)
- upload("config/deploy/#{stage}/nginx.key", "/tmp/nginx-#{stage}.key", :via => :scp, :roles => :lb)
- run "sudo cp /tmp/nginx-#{stage}.crt /etc/nginx/ssl/#{stage}.crt"
- run "sudo openssl rsa -passin pass:#{ssl_passphrase} -in /tmp/nginx-#{stage}.key -out /etc/nginx/ssl/#{stage}.key", :pty => true
- run "sudo cp /tmp/nginx-#{stage}.key /etc/nginx/ssl/#{stage}.key"
- run "sudo chmod 600 /etc/nginx/ssl/#{stage}.key"
- run "rm -f /tmp/nginx-#{stage}.crt /tmp/nginx-#{stage}.key"
- end
Add Comment
Please, Sign In to add comment