Repository navigation
Deploy: update the standby copy of the site on every push to main, also while production is down - #103
Merged
Conversation
…so while production is down
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.
The standby copy of anonshield.org only copied the images that production was running, every 10 minutes. With production down since 11/11, the standby is serving the site and is stuck on f272f94: #102 (the security updates) was built and published but never reached the site, because the deploy job waits for the production runner.
This adds a second deploy job, "Deploy to standby", on its own self-hosted runner on the standby host:
web/deploy-standby.sh <commit>pulls the backend and frontend images of the commit from GHCR (with the job'sGITHUB_TOKEN, no personal token on the host), copiesdocker-compose.a10.ymlandCaddyfile.a10, writes the tag into the standby's.envand recreates theazulcopy. If the new copy does not report the commit on/api/healthin 5 minutes, it goes back to the previous.envand files.https://anonshield.org/api/healthreports the commit.anonshield-standby(no default labels, not evenself-hosted), so no other job can land on it. Fork PRs from outside contributors now need approval before any workflow runs.There is no second copy to swap with on the standby, so while it serves, the site is down for as long as the backend takes to start. The production job is unchanged.
RUNBOOK: new "Standby copy" section.