Implement error tracking in SSH deployment script#6795
Open
ogmueller wants to merge 1 commit into
Open
Conversation
Member
|
The return-code tracking is the right fix. But deploy hooks must not call |
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add error handling to track deployment issues across multiple servers. Send notification on deployment error.
Currently if you deploy certificates to multiple servers using SSH, you will always get a success message. If one or all server fail due to any kind of connection errors, you will not see it in the end result (though you do get some error output). But the main problem is, that there is no notification nor a return code indicating an error.
This pull request improves error handling in the
ssh_deployfunction of the deployment script. Now, if deployment to any SSH server fails, the script will remember the failure, send a notification if appropriate, and return a non-zero exit code after attempting all servers.