lib/opskeleton/deploy_scp.rb in opskeleton-0.8.8 vs lib/opskeleton/deploy_scp.rb in opskeleton-0.8.9
- old
+ new
@@ -23,10 +23,13 @@
tar = "#{pkg.artifact_path}.tar.gz"
base = File.basename(tar)
if(File.exists?(tar))
begin
conf = Configuration.for('scp').send(dest.to_sym)
- Net::SCP.upload!(conf.host, conf.user, tar, conf.dest)
+ port = conf.port || '22'
+ Net::SSH.start(conf.host, conf.user, :port => port) do |session|
+ session.scp.upload!(tar, conf.dest)
+ end
say("deployed #{base} to #{conf.user}@#{conf.host}:#{conf.dest}")
rescue Exception => e
say("failed to deploy due to #{e}")
end
else