lasthourcloud/app/Jobs/ExecuteRemoteProcess.php
Andras Bacsai f57684b024 Add Servers and PrivateKeys
Add new testhost
Remove privatekey injection from Dockerfile
2023-03-24 22:15:36 +01:00

37 lines
914 B
PHP
Executable File

<?php
namespace App\Jobs;
use App\Actions\RemoteProcess\RunRemoteProcess;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Spatie\Activitylog\Models\Activity;
class ExecuteRemoteProcess implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct(
public Activity $activity,
){}
/**
* Execute the job.
*/
public function handle(): void
{
$remoteProcess = resolve(RunRemoteProcess::class, [
'activity' => $this->activity,
]);
$remoteProcess();
// @TODO: Remove file at $this->activity->getExtraProperty('private_key_location') after process is finished
}
}