From 44f8590fe8bd847ac967674018210a389c835c0c Mon Sep 17 00:00:00 2001 From: Vicens Juan Tomas Monserrat Date: Wed, 4 Feb 2026 10:00:03 +0100 Subject: [PATCH 1/2] fix: extract ZIP drop deployment to build server when configured --- packages/server/src/utils/builders/drop.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/server/src/utils/builders/drop.ts b/packages/server/src/utils/builders/drop.ts index 396c52d96..2dd578774 100644 --- a/packages/server/src/utils/builders/drop.ts +++ b/packages/server/src/utils/builders/drop.ts @@ -16,10 +16,13 @@ export const unzipDrop = async (zipFile: File, application: Application) => { try { const { appName } = application; - const { APPLICATIONS_PATH } = paths(!!application.serverId); + // Use buildServerId if set, otherwise fall back to serverId + // This ensures the code is extracted to the server where the build will run + const targetServerId = application.buildServerId || application.serverId; + const { APPLICATIONS_PATH } = paths(!!targetServerId); const outputPath = join(APPLICATIONS_PATH, appName, "code"); - if (application.serverId) { - await recreateDirectoryRemote(outputPath, application.serverId); + if (targetServerId) { + await recreateDirectoryRemote(outputPath, targetServerId); } else { await recreateDirectory(outputPath); } @@ -45,8 +48,8 @@ export const unzipDrop = async (zipFile: File, application: Application) => { ? rootEntries[0]?.entryName.split("/")[0] : ""; - if (application.serverId) { - sftp = await getSFTPConnection(application.serverId); + if (targetServerId) { + sftp = await getSFTPConnection(targetServerId); } for (const entry of zipEntries) { let filePath = entry.entryName; @@ -63,13 +66,13 @@ export const unzipDrop = async (zipFile: File, application: Application) => { const fullPath = path.join(outputPath, filePath).replace(/\\/g, "/"); - if (application.serverId) { + if (targetServerId) { if (!entry.isDirectory) { if (sftp === null) throw new Error("No SFTP connection available"); try { const dirPath = path.dirname(fullPath); await execAsyncRemote( - application.serverId, + targetServerId, `mkdir -p "${dirPath}"`, ); await uploadFileToServer(sftp, entry.getData(), fullPath); From 5c3b7acd54a434935f2c7e03a5f5951e4e9c4c1f Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 09:14:32 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- packages/server/src/utils/builders/drop.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/server/src/utils/builders/drop.ts b/packages/server/src/utils/builders/drop.ts index 2dd578774..e04f2d253 100644 --- a/packages/server/src/utils/builders/drop.ts +++ b/packages/server/src/utils/builders/drop.ts @@ -71,10 +71,7 @@ export const unzipDrop = async (zipFile: File, application: Application) => { if (sftp === null) throw new Error("No SFTP connection available"); try { const dirPath = path.dirname(fullPath); - await execAsyncRemote( - targetServerId, - `mkdir -p "${dirPath}"`, - ); + await execAsyncRemote(targetServerId, `mkdir -p "${dirPath}"`); await uploadFileToServer(sftp, entry.getData(), fullPath); } catch (err) { console.error(`Error uploading file ${fullPath}:`, err);