Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to run scripts locally without SSH. #43

Merged
merged 1 commit into from Feb 23, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -24,16 +24,25 @@ protected function getProcess($host, Task $task)
{
$target = $this->getConfiguredServer($host) ?: $host;
$script = 'set -e'.PHP_EOL.$task->script;
// Here we'll run the task on the localhost without any sort of SSH. This
// lets us run Envoy tasks locally just like any other remote connection.
if( in_array($target, ['local', 'localhost', '127.0.0.1']) )
{
$process = new Process($task->script);
}
// Here will run the SSH task on the server inline. We do not need to write the
// Here we'll run the SSH task on the server inline. We do not need to write the
// script out to a file or anything. We will start the SSH process then pass
// these lines of output back to the parent callback for display purposes.
$process = new Process(
'ssh '.$target.' \'bash -s\' << EOF
else
{
$script = 'set -e'.PHP_EOL.$task->script;
$process = new Process(
'ssh '.$target.' \'bash -s\' << EOF
'.$script.'
EOF'
);
);
}
return [$target, $process->setTimeout(null)];
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.