Merge pull request #1687 from Dokploy/git-fetch-origin-git-checkout-1659-environment-variable-parsing-issue-with-character-in-railpack-nuxt-app-or-other

fix(railpack): update environment variable handling to include quotes…
This commit is contained in:
Mauricio Siu 2025-04-12 02:30:47 -06:00 committed by GitHub
commit 692864ced1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,7 @@ export const buildRailpack = async (
for (const envVar of envVariables) { for (const envVar of envVariables) {
const [key, value] = envVar.split("="); const [key, value] = envVar.split("=");
if (key && value) { if (key && value) {
buildArgs.push("--secret", `id=${key},env=${key}`); buildArgs.push("--secret", `id=${key},env='${key}'`);
env[key] = value; env[key] = value;
} }
} }
@ -132,7 +132,7 @@ export const getRailpackCommand = (
]; ];
for (const env of envVariables) { for (const env of envVariables) {
prepareArgs.push("--env", env); prepareArgs.push("--env", `'${env}'`);
} }
// Calculate secrets hash for layer invalidation // Calculate secrets hash for layer invalidation
@ -164,7 +164,7 @@ export const getRailpackCommand = (
for (const envVar of envVariables) { for (const envVar of envVariables) {
const [key, value] = envVar.split("="); const [key, value] = envVar.split("=");
if (key && value) { if (key && value) {
buildArgs.push("--secret", `id=${key},env=${key}`); buildArgs.push("--secret", `id=${key},env='${key}'`);
exportEnvs.push(`export ${key}=${value}`); exportEnvs.push(`export ${key}=${value}`);
} }
} }