From bd82199ae0c28a4a09f9fe319412d61e52e7cfdc Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 21 Jun 2025 23:24:53 -0600 Subject: [PATCH] feat(rollback): implement rollback creation in deployment process - Added logic to create a rollback entry if the application has an active rollback during the deployment process. - Enhanced the rollback handling by determining the appropriate tag image based on the application's source type (docker or app name). --- packages/server/src/services/application.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts index 7c26e46b..179820b8 100644 --- a/packages/server/src/services/application.ts +++ b/packages/server/src/services/application.ts @@ -350,6 +350,17 @@ export const deployRemoteApplication = async ({ await updateDeploymentStatus(deployment.deploymentId, "done"); await updateApplicationStatus(applicationId, "done"); + if (application.rollbackActive) { + const tagImage = + application.sourceType === "docker" + ? application.dockerImage + : application.appName; + await createRollback({ + appName: tagImage || "", + deploymentId: deployment.deploymentId, + }); + } + await sendBuildSuccessNotifications({ projectName: application.project.name, applicationName: application.name,