change RSYNC_STDOUT to string

This commit is contained in:
Dragan Filipovic 2023-01-02 18:58:07 +01:00
parent 4e7456f7be
commit 177f5b4b79
4 changed files with 10 additions and 9 deletions

View file

@ -64,9 +64,10 @@ jobs:
SOURCE: "test_project/"
TARGET: "/var/www/html/"
EXCLUDE: "/dist/, /node_modules/"
# SCRIPT_BEFORE: |
# whoami
# ls -al
# SCRIPT_AFTER: |
# whoami
# ls -al
SCRIPT_BEFORE: |
whoami
ls -al
SCRIPT_AFTER: |
whoami
ls -al
echo $RSYNC_STDOUT

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -17,7 +17,7 @@ const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Prom
writeToFile({ dir: githubWorkspace, filename, content });
console.log(`Executing remote script: ssh -i ${privateKeyPath} ${sshServer}`, content);
exec(
`DEBIAN_FRONTEND=noninteractive ssh -i ${privateKeyPath} ${sshServer} 'RSYNC_STDOUT=${process.env.RSYNC_STDOUT} bash -s' < ${filename}`,
`DEBIAN_FRONTEND=noninteractive ssh -i ${privateKeyPath} ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
(err, data, stderr) => {
if (err) {
const message = `⚠️ [CMD] Remote script failed: ${err.message}`;

View file

@ -67,7 +67,7 @@ const sshDeploy = async (params) => {
await validateRsync();
const stdout = await rsyncCli(params);
console.log('✅ [Rsync] finished.', stdout);
process.env.RSYNC_STDOUT = stdout;
process.env.RSYNC_STDOUT = `${stdout}`;
return stdout;
};