diff --git a/app/Http/Controllers/Api/Deploy.php b/app/Http/Controllers/Api/Deploy.php index 04fc9b816..f071f3b5b 100644 --- a/app/Http/Controllers/Api/Deploy.php +++ b/app/Http/Controllers/Api/Deploy.php @@ -73,8 +73,8 @@ public function by_tags(string $tags, int $team_id, bool $force = false) $message->push("Tag {$tag} not found."); continue; } - $applications = $found_tag->applications(); - $services = $found_tag->services(); + $applications = $found_tag->applications()->get(); + $services = $found_tag->services()->get(); if ($applications->count() === 0 && $services->count() === 0) { $message->push("No resources found for tag {$tag}."); continue; @@ -97,7 +97,10 @@ public function by_tags(string $tags, int $team_id, bool $force = false) public function deploy_resource($resource, bool $force = false): Collection { $message = collect([]); - $type = $resource->getMorphClass(); + if (gettype($resource) !== 'object') { + return $message->push("Resource ($resource) not found."); + } + $type = $resource?->getMorphClass(); if ($type === 'App\Models\Application') { queue_application_deployment( application: $resource, diff --git a/app/Livewire/Tags/Show.php b/app/Livewire/Tags/Show.php index 3bb669615..05b25955a 100644 --- a/app/Livewire/Tags/Show.php +++ b/app/Livewire/Tags/Show.php @@ -50,13 +50,14 @@ public function get_deployments() public function redeploy_all() { try { - $this->applications->each(function ($resource) { + $message = collect([]); + $this->applications->each(function ($resource) use ($message) { $deploy = new Deploy(); - $deploy->deploy_resource($resource); + $message->push($deploy->deploy_resource($resource)); }); - $this->services->each(function ($resource) { + $this->services->each(function ($resource) use ($message) { $deploy = new Deploy(); - $deploy->deploy_resource($resource); + $message->push($deploy->deploy_resource($resource)); }); $this->dispatch('success', 'Mass deployment started.'); } catch (\Exception $e) { diff --git a/config/sentry.php b/config/sentry.php index 8013d44e6..2d8f7c7f3 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.208', + 'release' => '4.0.0-beta.209', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index 51db94a70..ff1387709 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@