mirror of
https://github.com/easingthemes/ssh-deploy
synced 2025-04-22 00:02:18 +00:00
fix ssh command server
This commit is contained in:
parent
668af68aa1
commit
0172041408
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -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
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -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;
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user