add destinations

This commit is contained in:
Andras Bacsai
2023-05-02 12:47:52 +02:00
parent 77c86400c0
commit 1a9f360132
16 changed files with 144 additions and 11 deletions

View File

@@ -119,7 +119,7 @@ if (!function_exists('formatDockerLabelsToJson')) {
}
}
if (!function_exists('runRemoteCommandSync')) {
function runRemoteCommandSync($server, array $command)
function runRemoteCommandSync(Server $server, array $command, $throwError = true)
{
$command_string = implode("\n", $command);
$private_key_location = savePrivateKeyForServer($server);
@@ -128,6 +128,9 @@ if (!function_exists('runRemoteCommandSync')) {
$output = trim($process->output());
$exitCode = $process->exitCode();
if ($exitCode !== 0) {
if (!$throwError) {
return false;
}
Log::error($output);
throw new \RuntimeException('There was an error running the command.');
}