mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2024-11-13 22:38:04 +00:00
Added SCRIPT_BEFORE_REQUIRED and SCRIPT_AFTER_REQUIRED flags for error throwing on remote cmd errors
This commit is contained in:
parent
3884c8554f
commit
f9797b28d5
@ -10,7 +10,8 @@ const run = async () => {
|
|||||||
source, remoteUser, remoteHost, remotePort,
|
source, remoteUser, remoteHost, remotePort,
|
||||||
deployKeyName, sshPrivateKey,
|
deployKeyName, sshPrivateKey,
|
||||||
args, exclude, sshCmdArgs,
|
args, exclude, sshCmdArgs,
|
||||||
scriptBefore, scriptAfter,
|
scriptBefore, scriptBeforeRequired,
|
||||||
|
scriptAfter, scriptAfterRequired,
|
||||||
rsyncServer
|
rsyncServer
|
||||||
} = inputs;
|
} = inputs;
|
||||||
// Validate required inputs
|
// Validate required inputs
|
||||||
@ -24,7 +25,7 @@ const run = async () => {
|
|||||||
}
|
}
|
||||||
// Check Script before
|
// Check Script before
|
||||||
if (scriptBefore) {
|
if (scriptBefore) {
|
||||||
await remoteCmdBefore(scriptBefore, privateKeyPath);
|
await remoteCmdBefore(scriptBefore, privateKeyPath, scriptBeforeRequired);
|
||||||
}
|
}
|
||||||
/* eslint-disable object-property-newline */
|
/* eslint-disable object-property-newline */
|
||||||
await sshDeploy({
|
await sshDeploy({
|
||||||
@ -33,7 +34,7 @@ const run = async () => {
|
|||||||
});
|
});
|
||||||
// Check script after
|
// Check script after
|
||||||
if (scriptAfter) {
|
if (scriptAfter) {
|
||||||
await remoteCmdAfter(scriptAfter, privateKeyPath);
|
await remoteCmdAfter(scriptAfter, privateKeyPath, scriptAfterRequired);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ const inputNames = [
|
|||||||
'REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT',
|
'REMOTE_HOST', 'REMOTE_USER', 'REMOTE_PORT',
|
||||||
'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME',
|
'SSH_PRIVATE_KEY', 'DEPLOY_KEY_NAME',
|
||||||
'SOURCE', 'TARGET', 'ARGS', 'SSH_CMD_ARGS', 'EXCLUDE',
|
'SOURCE', 'TARGET', 'ARGS', 'SSH_CMD_ARGS', 'EXCLUDE',
|
||||||
'SCRIPT_BEFORE', 'SCRIPT_AFTER'];
|
'SCRIPT_BEFORE', 'SCRIPT_AFTER', 'SCRIPT_BEFORE_REQUIRED', 'SCRIPT_AFTER_REQUIRED'];
|
||||||
|
|
||||||
const githubWorkspace = process.env.GITHUB_WORKSPACE;
|
const githubWorkspace = process.env.GITHUB_WORKSPACE;
|
||||||
const remoteUser = process.env.REMOTE_USER || process.env.INPUT_REMOTE_USER;
|
const remoteUser = process.env.REMOTE_USER || process.env.INPUT_REMOTE_USER;
|
||||||
|
Loading…
Reference in New Issue
Block a user