Guest User

Untitled

a guest
May 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. desc "upload certificate and key"
  2. task :upload_cert, :roles => :lb do
  3. set :ssl_passphrase, Proc.new { Capistrano::CLI.password_prompt('Certificate passphrase: ') }
  4. upload("config/deploy/#{stage}/nginx.crt", "/tmp/nginx-#{stage}.crt", :via => :scp, :roles => :lb)
  5. upload("config/deploy/#{stage}/nginx.key", "/tmp/nginx-#{stage}.key", :via => :scp, :roles => :lb)
  6. run "sudo cp /tmp/nginx-#{stage}.crt /etc/nginx/ssl/#{stage}.crt"
  7. run "sudo openssl rsa -passin pass:#{ssl_passphrase} -in /tmp/nginx-#{stage}.key -out /etc/nginx/ssl/#{stage}.key", :pty => true
  8. run "sudo cp /tmp/nginx-#{stage}.key /etc/nginx/ssl/#{stage}.key"
  9. run "sudo chmod 600 /etc/nginx/ssl/#{stage}.key"
  10. run "rm -f /tmp/nginx-#{stage}.crt /tmp/nginx-#{stage}.key"
  11. end
Add Comment
Please, Sign In to add comment