Merge pull request #1715 from coollabsio/next
fix: deploy issue with tag deployment
This commit is contained in:
commit
3d873a79a0
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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'),
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
return '4.0.0-beta.208';
|
||||
return '4.0.0-beta.209';
|
||||
|
@ -4,7 +4,7 @@
|
||||
"version": "3.12.36"
|
||||
},
|
||||
"v4": {
|
||||
"version": "4.0.0-beta.208"
|
||||
"version": "4.0.0-beta.209"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user