factorylabs-fdlcap 0.3.26 → 0.3.27
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fdlcap.gemspec +1 -1
- data/lib/fdlcap/recipes/ssh.rb +12 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.27
|
data/fdlcap.gemspec
CHANGED
data/lib/fdlcap/recipes/ssh.rb
CHANGED
@@ -3,13 +3,24 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
3
3
|
role = (ENV['ROLE'] || :app).to_sym
|
4
4
|
servers = find_servers :roles => role
|
5
5
|
server = servers.first
|
6
|
-
ssh_cmd = (
|
6
|
+
ssh_cmd = fetch(:ssh_cmd, '/usr/bin/ssh')
|
7
7
|
if server
|
8
8
|
`echo '#{password}' | /usr/bin/pbcopy`
|
9
9
|
exec "#{ssh_cmd} #{user}@#{server.host} -p #{server.port || 22} "
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
task :ssh_forever do
|
14
|
+
ssh_forever_binary = '/usr/bin/ssh-forever'
|
15
|
+
if File.exists?(ssh_forever_binary)
|
16
|
+
set :ssh_cmd, ssh_forever_binary
|
17
|
+
ssh
|
18
|
+
else
|
19
|
+
puts "#{ssh_forever_binary} not found - do you have the ssh-forever gem installed?"
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
#namespace :ssh do
|
14
25
|
task :tunnel do
|
15
26
|
remote_port = ENV['REMOTE_PORT'] || 80
|