Merge pull request #1715 from coollabsio/next

fix: deploy issue with tag deployment
This commit is contained in:
Andras Bacsai 2024-02-06 07:21:33 +01:00 committed by GitHub
commit 3d873a79a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 10 deletions

View File

@ -73,8 +73,8 @@ public function by_tags(string $tags, int $team_id, bool $force = false)
$message->push("Tag {$tag} not found."); $message->push("Tag {$tag} not found.");
continue; continue;
} }
$applications = $found_tag->applications(); $applications = $found_tag->applications()->get();
$services = $found_tag->services(); $services = $found_tag->services()->get();
if ($applications->count() === 0 && $services->count() === 0) { if ($applications->count() === 0 && $services->count() === 0) {
$message->push("No resources found for tag {$tag}."); $message->push("No resources found for tag {$tag}.");
continue; 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 public function deploy_resource($resource, bool $force = false): Collection
{ {
$message = collect([]); $message = collect([]);
$type = $resource->getMorphClass(); if (gettype($resource) !== 'object') {
return $message->push("Resource ($resource) not found.");
}
$type = $resource?->getMorphClass();
if ($type === 'App\Models\Application') { if ($type === 'App\Models\Application') {
queue_application_deployment( queue_application_deployment(
application: $resource, application: $resource,

View File

@ -50,13 +50,14 @@ public function get_deployments()
public function redeploy_all() public function redeploy_all()
{ {
try { try {
$this->applications->each(function ($resource) { $message = collect([]);
$this->applications->each(function ($resource) use ($message) {
$deploy = new Deploy(); $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 = new Deploy();
$deploy->deploy_resource($resource); $message->push($deploy->deploy_resource($resource));
}); });
$this->dispatch('success', 'Mass deployment started.'); $this->dispatch('success', 'Mass deployment started.');
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -7,7 +7,7 @@
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // 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 // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.208'; return '4.0.0-beta.209';

View File

@ -4,7 +4,7 @@
"version": "3.12.36" "version": "3.12.36"
}, },
"v4": { "v4": {
"version": "4.0.0-beta.208" "version": "4.0.0-beta.209"
} }
} }
} }