Add remote port

This commit is contained in:
Nicholas Piasecki 2023-01-04 12:18:09 -05:00
parent 845b7f6f1f
commit 0a1df91f97
3 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
const { exec } = require('child_process');
const { sshServer, githubWorkspace } = require('./inputs');
const { sshServer, githubWorkspace, remotePort } = require('./inputs');
const { writeToFile } = require('./helpers');
const handleError = (message, isRequired, callback) => {
@ -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}`);
exec(
`DEBIAN_FRONTEND=noninteractive ssh -i ${privateKeyPath} -o StrictHostKeyChecking=no ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
`DEBIAN_FRONTEND=noninteractive ssh -p ${(remotePort || 22)} -i ${privateKeyPath} -o StrictHostKeyChecking=no ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
(err, data, stderr) => {
if (err) {
const message = `⚠️ [CMD] Remote script failed: ${err.message}`;