relationship fix
This commit is contained in:
@@ -21,13 +21,13 @@ class RunStep implements ShouldQueue
|
|||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$this->step->load('service.server');
|
$this->step->load('deployment.target.server');
|
||||||
$this->step->update([
|
$this->step->update([
|
||||||
'status' => DeploymentStatus::IN_PROGRESS,
|
'status' => DeploymentStatus::IN_PROGRESS,
|
||||||
'started_at' => now(),
|
'started_at' => now(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$server = $this->step->service->server;
|
$server = $this->step->deployment->target->server;
|
||||||
|
|
||||||
$ssh = Ssh::create('root', $server->ipv4)
|
$ssh = Ssh::create('root', $server->ipv4)
|
||||||
->usePrivateKey(storage_path('private/ssh/id_ed25519'))
|
->usePrivateKey(storage_path('private/ssh/id_ed25519'))
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Deployment extends Model
|
|||||||
return $this->hasMany(Step::class);
|
return $this->hasMany(Step::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deployable(): MorphTo
|
public function target(): MorphTo
|
||||||
{
|
{
|
||||||
return $this->morphTo('target');
|
return $this->morphTo('target');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user