class Object

Public Instance Methods

exec_on_remote(command, message="Executing command on remote...", container_id='web') click to toggle source
# File lib/docker_houston/capistrano.rb, line 20
def exec_on_remote(command, message="Executing command on remote...", container_id='web')
  on roles :app do |server|
    ssh_cmd = "ssh -A -t #{server.user}@#{server.hostname}"
    puts message
    exec "#{ssh_cmd} 'cd #{fetch(:release_dir)} && docker-compose -f docker-compose.yml -f docker-compose.prod.yml -p #{fetch(:app_with_stage)} run web #{command}'"
  end
end
exec_on_server(command, message="Executing on docker server...") click to toggle source
# File lib/docker_houston/capistrano.rb, line 28
def exec_on_server(command, message="Executing on docker server...")
  on roles :app do |server|
    ssh_cmd = "ssh -A -t #{server.user}@#{server.hostname}"
    puts message
    exec "#{ssh_cmd} '#{command}'"
  end
end