From cd3af7fa390214620c80697485b0a11d0645ed3a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 1 Dec 2022 15:05:21 +0100 Subject: [PATCH] fix: failed builds should not push images --- apps/api/src/jobs/deployApplication.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts index 6203ce087..48e3a3173 100644 --- a/apps/api/src/jobs/deployApplication.ts +++ b/apps/api/src/jobs/deployApplication.ts @@ -185,6 +185,10 @@ import * as buildpacks from '../lib/buildPacks'; if (error !== 1) { await saveBuildLog({ line: error, buildId, applicationId: application.id }); } + if (!isDev) { + await fs.rm(workdir, { recursive: true, force: true }); + } + return; } try { if (application.dockerRegistryImageName) { @@ -600,6 +604,10 @@ import * as buildpacks from '../lib/buildPacks'; if (error !== 1) { await saveBuildLog({ line: error, buildId, applicationId: application.id }); } + if (!isDev) { + await fs.rm(workdir, { recursive: true, force: true }); + } + return; } try { if (application.dockerRegistryImageName) {