Created
February 8, 2016 06:03
-
-
Save shivabhusal/44e5815dd803f71ea3b5 to your computer and use it in GitHub Desktop.
Using capistrano's SSHKit library you can move file from local to server from your Rails console or IRB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sshkit' | |
require 'sshkit/dsl' | |
on ['deployer@XX.79.200.XXX'] do | |
# upload! '/home/john/Downloads/__thepact_com/__thepact_com.crt', '/home/deployer/__thepact_com.crt' | |
# upload! '/home/john/Downloads/__thepact_com/__thepact_com.p7b', '/home/deployer/__thepact_com.p7b' | |
upload! '/home/john/Downloads/__thepact_com/__thepact_com.ca-bundle', '/home/deployer/__thepact_com.ca-bundle' | |
within '/home/deployer/' do | |
# execute 'sudo', 'mv', '/home/deployer/__thepact_com.crt', '/opt/nginx/ssl/__thepact_com.crt' | |
# execute 'sudo', 'mv', '/home/deployer/__thepact_com.p7b', '/opt/nginx/ssl/__thepact_com.p7b' | |
execute 'sudo', 'mv', '/home/deployer/__thepact_com.ca-bundle', '/opt/nginx/ssl/__thepact_com.ca-bundle' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment