From c4519256cf0c88fa1917121ff960e3af94bf9023 Mon Sep 17 00:00:00 2001 From: Kirill <8945959+kirill-dev-pro@users.noreply.github.com> Date: Wed, 1 Oct 2025 23:05:54 +0300 Subject: [PATCH 1/4] Pass DOKPLOY_DEPLOY_URL as build time argument so it can be used during build --- packages/server/src/services/application.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts index e9cde27c5..c68ef2ba9 100644 --- a/packages/server/src/services/application.ts +++ b/packages/server/src/services/application.ts @@ -472,7 +472,7 @@ export const deployPreviewApplication = async ({ }); application.appName = previewDeployment.appName; application.env = `${application.previewEnv}\nDOKPLOY_DEPLOY_URL=${previewDeployment?.domain?.host}`; - application.buildArgs = application.previewBuildArgs; + application.buildArgs = `${application.previewBuildArgs}\nDOKPLOY_DEPLOY_URL=${previewDeployment?.domain?.host}`; if (application.sourceType === "github") { await cloneGithubRepository({ @@ -579,7 +579,7 @@ export const deployRemotePreviewApplication = async ({ }); application.appName = previewDeployment.appName; application.env = `${application.previewEnv}\nDOKPLOY_DEPLOY_URL=${previewDeployment?.domain?.host}`; - application.buildArgs = application.previewBuildArgs; + application.buildArgs = `${application.previewBuildArgs}\nDOKPLOY_DEPLOY_URL=${previewDeployment?.domain?.host}`; if (application.serverId) { let command = "set -e;"; From f6ff90eed9f2e6b40b95a8e4f4107c685801cac6 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:16:25 -0600 Subject: [PATCH 2/4] fix(application): correct log path variable usage and update label syntax in getApplicationStats function --- packages/server/src/services/application.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts index 1de307571..aee22da5a 100644 --- a/packages/server/src/services/application.ts +++ b/packages/server/src/services/application.ts @@ -664,11 +664,10 @@ export const rebuildRemoteApplication = async ({ await execAsyncRemote( application.serverId, ` - echo "\n\n===================================EXTRA LOGS============================================" >> $deployment.logPath; - echo "Error occurred ❌, check the logs for details." >> $deployment.logPath; + echo "\n\n===================================EXTRA LOGS============================================" >> ${deployment.logPath}; + echo "Error occurred ❌, check the logs for details." >> ${deployment.logPath}; echo "${encodedContent}" | base64 -d >> "${deployment.logPath}";`, ); - await updateDeploymentStatus(deployment.deploymentId, "error"); await updateApplicationStatus(applicationId, "error"); throw error; @@ -680,7 +679,7 @@ export const rebuildRemoteApplication = async ({ export const getApplicationStats = async (appName: string) => { const filter = { status: ["running"], - label: ["com.docker.swarm.service.name=$appName"], + label: [`com.docker.swarm.service.name=${appName}`], }; const containers = await docker.listContainers({ From e5aeff6106b27c2f9f6fb48e239835faad4be5bf Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:17:27 -0600 Subject: [PATCH 3/4] fix(application): update deployment comment syntax to use template literals for dynamic content --- packages/server/src/services/application.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts index aee22da5a..722b3f84b 100644 --- a/packages/server/src/services/application.ts +++ b/packages/server/src/services/application.ts @@ -576,7 +576,7 @@ export const deployRemotePreviewApplication = async ({ ); await updateIssueComment({ ...issueParams, - body: "### Dokploy Preview Deployment\n\n$buildingComment", + body: `### Dokploy Preview Deployment\n\n${buildingComment}`, }); application.appName = previewDeployment.appName; application.env = `${application.previewEnv}\nDOKPLOY_DEPLOY_URL=${previewDeployment?.domain?.host}`; @@ -607,7 +607,7 @@ export const deployRemotePreviewApplication = async ({ ); await updateIssueComment({ ...issueParams, - body: "### Dokploy Preview Deployment\n\n$successComment", + body: `### Dokploy Preview Deployment\n\n${successComment}`, }); await updateDeploymentStatus(deployment.deploymentId, "done"); await updatePreviewDeployment(previewDeploymentId, { @@ -617,7 +617,7 @@ export const deployRemotePreviewApplication = async ({ const comment = getIssueComment(application.name, "error", previewDomain); await updateIssueComment({ ...issueParams, - body: "### Dokploy Preview Deployment\n\n$comment", + body: `### Dokploy Preview Deployment\n\n${comment}`, }); await updateDeploymentStatus(deployment.deploymentId, "error"); await updatePreviewDeployment(previewDeploymentId, { From 14e154beceb82bd743e4f407baa3908b3fd9a508 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:18:09 -0600 Subject: [PATCH 4/4] fix(application): use template literals for dynamic content in deployment comments --- packages/server/src/services/application.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts index 722b3f84b..1891f9b6b 100644 --- a/packages/server/src/services/application.ts +++ b/packages/server/src/services/application.ts @@ -491,7 +491,7 @@ export const deployPreviewApplication = async ({ ); await updateIssueComment({ ...issueParams, - body: "### Dokploy Preview Deployment\n\n$successComment", + body: `### Dokploy Preview Deployment\n\n${successComment}`, }); await updateDeploymentStatus(deployment.deploymentId, "done"); await updatePreviewDeployment(previewDeploymentId, { @@ -501,7 +501,7 @@ export const deployPreviewApplication = async ({ const comment = getIssueComment(application.name, "error", previewDomain); await updateIssueComment({ ...issueParams, - body: "### Dokploy Preview Deployment\n\n$comment", + body: `### Dokploy Preview Deployment\n\n${comment}`, }); await updateDeploymentStatus(deployment.deploymentId, "error"); await updatePreviewDeployment(previewDeploymentId, {