Sha256: 1068c8d67969adb0f95f35f1edcf084be9bf764a1aa9e2564a80b45c29bb86b8

Contents?: true

Size: 888 Bytes

Versions: 21

Compression:

Stored size: 888 Bytes

Contents

desc 'SSH connection with server'
task :ssh do
  on roles(:app) do |host|
    run_locally do
      run_in host, ""
    end
  end
end

desc 'Opens a remote Rails console'
task :c do
  on roles(:app) do |host|
    run_locally do
      run_in host, "cd #{current_path} && RAILS_ENV=#{fetch(:stage)} bundle exec rails c"
    end
  end
end

desc 'Tails the environment log or the log passed as argument: cap log[thin.3000.log]'
task :log, :file do |task, args|
  on roles(:app) do
    file = args[:file]? args[:file] : "#{fetch(:stage)}.log"
    execute "tail -f #{shared_path}/log/#{file}"
  end
end

desc "Runs a command in server: cap production x['free -m']"
task :x, :command do |task, args|
  on roles(:app) do |host|
    run_locally do
      run_in host, args[:command]
    end
  end
end

def run_in(host, cmd)
  exec "ssh #{host.user}@#{host.hostname} -p #{host.port} -tt '#{cmd}'"
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
prun-ops-0.0.22 lib/capistrano/diagnosis.rake
prun-ops-0.0.21 lib/capistrano/diagnosis.rake
prun-ops-0.0.20 lib/capistrano/diagnosis.rake
prun-ops-0.0.19 lib/capistrano/diagnosis.rake
prun-ops-0.0.18 lib/capistrano/diagnosis.rake
prun-ops-0.0.17 lib/capistrano/diagnosis.rake
prun-ops-0.0.16 lib/capistrano/diagnosis.rake
prun-ops-0.0.15 lib/capistrano/diagnosis.rake
prun-ops-0.0.14 lib/capistrano/diagnosis.rake
prun-ops-0.0.13 lib/capistrano/diagnosis.rake
prun-ops-0.0.12 lib/capistrano/diagnosis.rake
prun-ops-0.0.11 lib/capistrano/diagnosis.rake
prun-ops-0.0.10 lib/capistrano/diagnosis.rake
prun-ops-0.0.9 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.8 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.7 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.6 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.5 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.4 lib/prun-ops/cap/diagnosis.rb
prun-ops-0.0.3 lib/prun-ops/cap/diagnosis.rb