Sha256: 63c91c59c5dcfebaf07be3c2d5b095181f0975f6066f5e093fcb61dd6718592b

Contents?: true

Size: 519 Bytes

Versions: 10

Compression:

Stored size: 519 Bytes

Contents

namespace :ssh do
  desc 'SSH connect and move to current folder'
  task :connect do
    on roles(:app) do |server|
      server_index = ARGV[2].to_i

      return if server != roles(:app)[server_index]

      info "Opening a console on: #{server} ..."
      params = "#{fetch(:user)}@#{server}"
      params += " -p #{server.port}" if server.port
      params += %( -t "cd #{fetch(:deploy_to)}/current && bash -l")
      info "Connection success for user: #{fetch(:user)}"
      exec "ssh #{params}"
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
dcs-best-practices-0.0.5 lib/capistrano/tasks/ssh.cap
dcs-best-practices-0.0.4 lib/capistrano/tasks/ssh.cap
dcs-best-practices-0.0.3 lib/capistrano/tasks/ssh.cap
dcs-best-practices-0.0.2 lib/capistrano/tasks/ssh.cap
dcs-best-practices-0.0.1 lib/capistrano/tasks/ssh.cap
locum-best-practices-0.4.5 lib/capistrano/tasks/ssh.cap
locum-best-practices-0.3.0 lib/capistrano/tasks/ssh.cap
locum-best-practices-0.2.4 lib/capistrano/tasks/ssh.cap
locum-best-practices-0.2.3 lib/capistrano/tasks/ssh.cap
locum-best-practices-0.2.2 lib/capistrano/tasks/ssh.cap