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