deploy/ssh: return non-zero when a server deployment fails (#6795)
ssh_deploy() ignored the result of _ssh_deploy and always returned success, so a failed transfer to one (or all) of the servers in DEPLOY_SSH_SERVER was silently swallowed. Track the return code across the loop and return non-zero if any server failed, letting the caller handle notification. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
Unverified
parent
58423df3e8
commit
1f778e6ef1
+7
-1
@@ -170,10 +170,16 @@ ssh_deploy() {
|
|||||||
_info "Required commands batched and sent in single call to remote host"
|
_info "Required commands batched and sent in single call to remote host"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
_returnCode=0
|
||||||
_deploy_ssh_servers="$DEPLOY_SSH_SERVER"
|
_deploy_ssh_servers="$DEPLOY_SSH_SERVER"
|
||||||
for DEPLOY_SSH_SERVER in $_deploy_ssh_servers; do
|
for DEPLOY_SSH_SERVER in $_deploy_ssh_servers; do
|
||||||
_ssh_deploy
|
if ! _ssh_deploy; then
|
||||||
|
# in case of an error, remember it, but keep going for the remaining servers
|
||||||
|
_returnCode=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
return $_returnCode
|
||||||
}
|
}
|
||||||
|
|
||||||
_ssh_deploy() {
|
_ssh_deploy() {
|
||||||
|
|||||||
Reference in New Issue
Block a user