feat(Deployment): enhance queue_application_deployment to handle existing deployments and return appropriate status messages

This commit is contained in:
Andras Bacsai
2025-04-11 15:27:56 +02:00
parent 01f361216d
commit d075241289
11 changed files with 272 additions and 86 deletions

View File

@@ -79,7 +79,7 @@ class Destination extends Component
$deployment_uuid = new Cuid2;
$server = Server::ownedByCurrentTeam()->findOrFail($server_id);
$destination = $server->standaloneDockers->where('id', $network_id)->firstOrFail();
queue_application_deployment(
$result = queue_application_deployment(
deployment_uuid: $deployment_uuid,
application: $this->resource,
server: $server,
@@ -87,6 +87,11 @@ class Destination extends Component
only_this_server: true,
no_questions_asked: true,
);
if ($result['status'] === 'skipped') {
$this->dispatch('success', 'Deployment skipped', $result['message']);
return;
}
return redirect()->route('project.application.deployment.show', [
'project_uuid' => data_get($this->resource, 'environment.project.uuid'),