From 967a87a02431e25664ad3e0d079973d1d078d5c2 Mon Sep 17 00:00:00 2001 From: "Harry (hjbdev)" Date: Mon, 31 Mar 2025 16:38:07 +0000 Subject: [PATCH] asd --- app/Jobs/Services/RunStep.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Jobs/Services/RunStep.php b/app/Jobs/Services/RunStep.php index 207f231..7b8e0e6 100644 --- a/app/Jobs/Services/RunStep.php +++ b/app/Jobs/Services/RunStep.php @@ -3,6 +3,7 @@ namespace App\Jobs\Services; use App\Enums\DeploymentStatus; +use App\Enums\ServiceStatus; use App\Models\Step; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Queue\Queueable; @@ -59,6 +60,14 @@ class RunStep implements ShouldQueue // Dispatch the next step if available if ($nextStep = $this->step->deployment->steps()->where('order', '>', $this->step->order)->orderBy('order', 'asc')->first()) { $nextStep->dispatchJob(); + } else { + $this->step->deployment->update([ + 'status' => DeploymentStatus::COMPLETED, + 'finished_at' => now(), + ]); + $this->step->deployment->target->update([ + 'status' => ServiceStatus::RUNNING, + ]); } } }