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