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

@@ -84,11 +84,16 @@ class Heading extends Component
return;
}
$this->setDeploymentUuid();
queue_application_deployment(
$result = queue_application_deployment(
application: $this->application,
deployment_uuid: $this->deploymentUuid,
force_rebuild: $force_rebuild,
);
if ($result['status'] === 'skipped') {
$this->dispatch('success', 'Deployment skipped', $result['message']);
return;
}
return $this->redirectRoute('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
@@ -126,11 +131,16 @@ class Heading extends Component
return;
}
$this->setDeploymentUuid();
queue_application_deployment(
$result = queue_application_deployment(
application: $this->application,
deployment_uuid: $this->deploymentUuid,
restart_only: true,
);
if ($result['status'] === 'skipped') {
$this->dispatch('success', 'Deployment skipped', $result['message']);
return;
}
return $this->redirectRoute('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],

View File

@@ -159,13 +159,18 @@ class Previews extends Component
'pull_request_html_url' => $pull_request_html_url,
]);
}
queue_application_deployment(
$result = queue_application_deployment(
application: $this->application,
deployment_uuid: $this->deployment_uuid,
force_rebuild: false,
pull_request_id: $pull_request_id,
git_type: $found->git_type ?? null,
);
if ($result['status'] === 'skipped') {
$this->dispatch('success', 'Deployment skipped', $result['message']);
return;
}
return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],