Class: Wordmove::Actions::Ssh::RunRemoteCommand
- Inherits:
-
Object
- Object
- Wordmove::Actions::Ssh::RunRemoteCommand
- Extended by:
- LightService::Action
- Includes:
- Helpers
- Defined in:
- lib/wordmove/actions/ssh/run_remote_command.rb
Overview
Note:
The remote server is already configured inside the Photocopier object
Note:
This action is not meant to be organized, but as a standalone one.
Run a command on a remote host using Photocopier
Class Method Summary collapse
-
.execute ⇒ LightService::Context
Action’s context.
Class Method Details
.execute ⇒ LightService::Context
Returns Action’s context.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/wordmove/actions/ssh/run_remote_command.rb', line 24 executed do |context| context.logger.task_step false, context.command next context if simulate?(cli_options: context.) _stdout, stderr, exit_code = context.photocopier.exec!(context.command) next context if exit_code.zero? context.fail! "Error code #{exit_code} returned by command " \ "#{context.command}: #{stderr}" end |