From efb8e73815d416f5bda0db7b8d00c9f608c2af45 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 11 Dec 2024 12:49:11 +0700 Subject: [PATCH] Allow explicit pass vars --- package-lock.json | 4 ++-- package.json | 2 +- src/executor/runner.js | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9370411..4202524 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "domcloud-bridge", - "version": "1.0.241124", + "version": "1.0.241211", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "domcloud-bridge", - "version": "1.0.241124", + "version": "1.0.241211", "license": "MIT", "dependencies": { "cli": "^1.0.1", diff --git a/package.json b/package.json index 2431b87..0af02b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "domcloud-bridge", - "version": "1.0.241124", + "version": "1.0.241211", "description": "Deployment runner for DOM Cloud", "main": "app.js", "engines": { diff --git a/src/executor/runner.js b/src/executor/runner.js index 4072d18..3432c43 100644 --- a/src/executor/runner.js +++ b/src/executor/runner.js @@ -346,7 +346,13 @@ export default async function runConfig(config, domain, writer, sandbox = false) await sshExec('unset HISTFILE TERM', false); // https://stackoverflow.com/a/9039154/3908409 await sshExec(`export CI=true CONTINUOUS_INTEGRATION=true LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 `, false); await sshExec(`export PIP_PROGRESS_BAR=off BUILDKIT_PROGRESS=plain`, false); - await sshExec(`USERNAME='${domaindata['Username']}' PASSWORD='${pw}'`, false); + await sshExec(` USERNAME='${domaindata['Username']}' PASSWORD='${pw}'`, false); + if (domaindata['Password for mysql']) { + await sshExec(` MY_PASSWORD='${domaindata['Password for mysql']}'`, false); + } + if (domaindata['Password or postgres']) { + await sshExec(` PG_PASSWORD='${domaindata['Password or postgres']}'`, false); + } const firewallOn = await firewallStatus(); if (config.subdomain) { await runConfigSubdomain(config, domaindata, [config.subdomain, domain].join('.'), sshExec, writeLog, virtExec, firewallOn);