lasthourcloud/bootstrap/helpers.php

20 lines
472 B
PHP
Raw Normal View History

2023-03-20 12:04:22 +00:00
<?php
use App\Actions\RemoteProcess\DispatchRemoteProcess;
2023-03-20 12:04:22 +00:00
use Spatie\Activitylog\Contracts\Activity;
if (! function_exists('remoteProcess')) {
2023-03-20 12:04:22 +00:00
/**
* Run a Coolify Process, which SSH's into a machine to run the command(s).
*
*/
function remoteProcess($command, $destination): Activity
2023-03-20 12:04:22 +00:00
{
return resolve(DispatchRemoteProcess::class, [
2023-03-20 12:04:22 +00:00
'destination' => $destination,
'command' => $command,
])();
2023-03-20 12:04:22 +00:00
}
}