Repository navigation
Add a code deploy tag and restart on version mismatch - #49
Merged
Merged
Conversation
`--tags code` builds, installs the binary, restarts and waits for the new version, skipping firewall, user, config, seeding and Prometheus tasks. A run that failed after installing the binary dropped the pending restart, and the next run saw an unchanged binary and never restarted, leaving the old process running. Compare the running build_info version with the one just built and restart when they differ, then poll until the running process reports the deployed version. Co-Authored-By: Claude Opus 5.5 <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.
Why
Install sshgate binaryhad copied the new binary and notifiedRestart sshgate. Ansible drops pending handlers when a play fails. The rerun built a byte-identical binary, so the copy task wasok, nothing notified the handler, and every host kept running the old process (mx: v0.6.0 on disk, v0.5.0-2-g5ad8110 running since Sep 14). The existing verify step only checked thatsshgate_build_infoexisted, so it passed.What
--tags code: describe, build, install binary, restart (graceful reload when running), reconnect, verify.Check which sshgate version is runningtask compares the runningsshgate_build_infoversion with the one just built and notifiesRestart sshgatewhen they differ (or the endpoint is unreachable). Runs in full andcoderuns.docs/deployment.md: documents--tags codeand the mismatch restart.Testing
ansible-playbook --syntax-checkpasses;--list-tasks --tags codelists the 8 intended tasks.v0.6.0→changed(restart queued), expecting the runningv0.5.0-2-g5ad8110→ok, unreachable endpoint →changed.🤖 Generated with Claude Code