diff --git a/app/Jobs/Services/RunStep.php b/app/Jobs/Services/RunStep.php index 7800628..2986c7b 100644 --- a/app/Jobs/Services/RunStep.php +++ b/app/Jobs/Services/RunStep.php @@ -21,13 +21,13 @@ class RunStep implements ShouldQueue public function handle(): void { - $this->step->load('service.server'); + $this->step->load('deployment.target.server'); $this->step->update([ 'status' => DeploymentStatus::IN_PROGRESS, 'started_at' => now(), ]); - $server = $this->step->service->server; + $server = $this->step->deployment->target->server; $ssh = Ssh::create('root', $server->ipv4) ->usePrivateKey(storage_path('private/ssh/id_ed25519')) diff --git a/app/Models/Deployment.php b/app/Models/Deployment.php index 66929a9..c4552f4 100644 --- a/app/Models/Deployment.php +++ b/app/Models/Deployment.php @@ -23,7 +23,7 @@ class Deployment extends Model return $this->hasMany(Step::class); } - public function deployable(): MorphTo + public function target(): MorphTo { return $this->morphTo('target'); }