Deploy: install exactly the tested commit, refuse replays, roll back if unhealthy (#55, part 2) #77
Open
jared
wants to merge 1 commits from
deploy-pinned into main
pull from: deploy-pinned
merge into: LotusGuild:main
LotusGuild:main
LotusGuild:recurrence-like-thor
LotusGuild:pr-73-screenshots
LotusGuild:inbound-flood-alert
LotusGuild:pr-64-screenshots
LotusGuild:pr-63-screenshots
LotusGuild:kuma-token
LotusGuild:modem-restart
LotusGuild:modem-extras-screenshots
LotusGuild:modem-extras
LotusGuild:modem-login-screenshots
LotusGuild:modem-login
LotusGuild:pr-47-screenshots
LotusGuild:polish
LotusGuild:pr-46-screenshots
LotusGuild:wan-health
LotusGuild:pr-45-screenshots
LotusGuild:attention-list
LotusGuild:port-name-report
LotusGuild:pr-44-screenshots
LotusGuild:readme-power-polish
LotusGuild:pr-42-screenshots
LotusGuild:stale-outlet-watts
LotusGuild:pr-41-screenshots
LotusGuild:topology-polish
LotusGuild:pr-40-screenshots
LotusGuild:power-map
LotusGuild:pr-39-screenshots
LotusGuild:topology
LotusGuild:pr-37-screenshots
LotusGuild:stale-alerts
LotusGuild:pr-36-screenshots
LotusGuild:wan-incidents
LotusGuild:pr-35-screenshots
LotusGuild:unused-interfaces
LotusGuild:pr-32-screenshots
LotusGuild:loose-gear-on-top
LotusGuild:tinker-create-action
LotusGuild:revert-31
LotusGuild:stale-interface-alerts
LotusGuild:zimaboard-and-facing
LotusGuild:pr-30-screenshots
LotusGuild:pr-29-screenshots
LotusGuild:pro-max-faceplates
LotusGuild:rack-unlinked-port-clicks
LotusGuild:pr-27-screenshots
LotusGuild:rack-drawn-fronts
LotusGuild:rack-panel-label
LotusGuild:pr-25-screenshots
LotusGuild:rack-rear-and-settings
LotusGuild:pr-24-screenshots
LotusGuild:racks-shelves-export
LotusGuild:pr-23-screenshots
LotusGuild:rack-view
LotusGuild:pr-22-screenshots
LotusGuild:inventory-and-faceplate-marks
LotusGuild:pr-21-screenshots
LotusGuild:events-history
LotusGuild:ticket-recovery-and-context
LotusGuild:pr-18-screenshots
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part 2 of #55. This PR is stacked on #76: its base is
ci-deploy-gate. Once #76 merges, I'll point it atmain.deploy/gandalf_deploy.sh <sha> <ts>Modelled on Pulse's
deploy/pulse_deploy.sh, which has been in use there since #45. The webhook runs it from its installed copy,/usr/local/bin/gandalf_app_deploy.sh, so a bad commit can't replace the code that rolls it back. It:origin/main;requirements.txt, and restartsgandalfandgandalf-monitor;/healthto report the commit as bothshaandmonitor_sha(added in #76) with status ok, and rolls back to the previous commit if it never does.It runs one deploy at a time (
flock) and logs to/var/log/gandalf-app-deploy.log.Tests
tests/test_deploy_script.pyruns the real script in a sandbox: throwaway git repos, with fakesystemctl,pip3andcurl. 7 tests:config.jsonalone;mainand malformed requests;shellcheck, flake8 and bandit are clean.
Rollout, in this order (each server step needs your OK)
shaandts, so nothing changes yet.install -m 755 /var/www/html/prod/deploy/gandalf_deploy.sh /usr/local/bin/gandalf_app_deploy.sh/etc/webhook/hooks.json, point thegandalf-deployhook'sexecute-commandat it, withpass-arguments-to-commandforshaandts;webhook.157-config-deployhook, run by pushes to pve-infra, stays on the pve-infra script for now.containers/157-gandalf/deploy.shconfig-only. It would keep the systemd units and the nginx site, and stop resetting the app toorigin/main, so a pve-infra push can't deploy an untested Gandalf commit. That's a separate pve-infra PR.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.