-
-
Save mostafa6765/205781ec578fbd37e9f01c221a092f33 to your computer and use it in GitHub Desktop.
Call Envoy from Route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = []; | |
$task = 'deploy'; | |
$live = true; | |
$process = new \Symfony\Component\Process\Process('/Applications/MAMP/bin/php/php7.1.0/bin/php ~/.composer/vendor/bin/envoy run '. $task); | |
$process->setTimeout(3600); | |
$process->setIdleTimeout(300); | |
$process->setWorkingDirectory(base_path()); | |
$process->run( | |
function ($type, $buffer) use ($live, &$result) { | |
$buffer = str_replace('[-i ~/.ssh/host_key [email protected]]: ', '', $buffer); | |
if ($live) { | |
echo $buffer . '</br />'; | |
} | |
$result[] = $buffer; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment