fix ssh command server

This commit is contained in:
Dragan Filipovic 2023-01-02 02:13:02 +01:00
parent 668af68aa1
commit 0172041408
4 changed files with 8 additions and 7 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ const run = () => {
deployKeyName, sshPrivateKey, deployKeyName, sshPrivateKey,
args, exclude, sshCmdArgs, args, exclude, sshCmdArgs,
scriptBefore, scriptAfter, scriptBefore, scriptAfter,
sshServer rsyncServer
} = inputs; } = inputs;
// Validate required inputs // Validate required inputs
validateRequiredInputs({ sshPrivateKey, remoteHost, remoteUser }); validateRequiredInputs({ sshPrivateKey, remoteHost, remoteUser });
@ -30,7 +30,7 @@ const run = () => {
} }
/* eslint-disable object-property-newline */ /* eslint-disable object-property-newline */
sshDeploy({ sshDeploy({
source, sshServer, exclude, remotePort, source, rsyncServer, exclude, remotePort,
privateKey, args, sshCmdArgs, callback privateKey, args, sshCmdArgs, callback
}); });
}; };

View File

@ -42,6 +42,7 @@ inputNames.forEach((input) => {
inputs[inputName] = extendedVal; inputs[inputName] = extendedVal;
}); });
inputs.sshServer = `${inputs.remoteUser}@${inputs.remoteHost}:${inputs.target}`; inputs.sshServer = `${inputs.remoteUser}@${inputs.remoteHost}`;
inputs.rsyncServer = `${inputs.remoteUser}@${inputs.remoteHost}:${inputs.target}`;
module.exports = inputs; module.exports = inputs;

View File

@ -29,10 +29,10 @@ const validateRsync = new Promise(async (resolve, reject) => {
}); });
const rsyncCli = ({ const rsyncCli = ({
source, sshServer, exclude, remotePort, source, rsyncServer, exclude, remotePort,
privateKey, args, sshCmdArgs, callback privateKey, args, sshCmdArgs, callback
}) => { }) => {
console.log(`[Rsync] Starting Rsync Action: ${source} to ${sshServer}`); console.log(`[Rsync] Starting Rsync Action: ${source} to ${rsyncServer}`);
if (exclude) console.log(`[Rsync] excluding folders ${exclude}`); if (exclude) console.log(`[Rsync] excluding folders ${exclude}`);
const defaultOptions = { const defaultOptions = {
@ -45,7 +45,7 @@ const rsyncCli = ({
/* eslint-disable object-property-newline */ /* eslint-disable object-property-newline */
nodeRsync({ nodeRsync({
...defaultOptions, ...defaultOptions,
src: source, dest: sshServer, excludeFirst: exclude, port: remotePort, src: source, dest: rsyncServer, excludeFirst: exclude, port: remotePort,
privateKey, args, sshCmdArgs, privateKey, args, sshCmdArgs,
}, (error, stdout, stderr, cmd) => { }, (error, stdout, stderr, cmd) => {
if (error) { if (error) {