Repository navigation
Deploy the Compose stack on push to deploy, with SHA-tagged images and rollback
#14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4467017
feat(infra): deploy the Compose stack on push to `deploy`, with rollback
hutusi 235481e
fix(infra): constrain, verify and roll back the deploy properly
hutusi b6bb675
fix(infra): stop leaking database dumps, and verify what rollback claims
hutusi 54e8f85
fix(infra): tag images with the full SHA and let stale :latest be pruned
hutusi 3a1437d
fix(infra): abort rollback on a failed restore, and bound the worker …
hutusi 146c4e0
fix(infra): make the restore actually revert, bound the timeout, and …
hutusi dca53d7
test(infra): cover dump retention, and cap the health sleep by the de…
hutusi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Janus deploy pipeline — runs on the Agrippa host itself. | ||
| # | ||
| # Deliberately not .janus/ci.yml (the default path): the GitCode webhook selects | ||
| # this file with ?pipeline_path=.janus/deploy.yml, which leaves ci.yml free if | ||
| # Janus ever runs tests for this repo too, rather than conflating deploy and CI. | ||
| # | ||
| # Trigger is the `deploy` branch, not main: main takes doc-only commits, and | ||
| # this is the only environment — going live should be a deliberate | ||
| # fast-forward, and rolling back is moving the branch. | ||
| # | ||
| # Janus checks the repo out into its own workspace as the `janus` user; that | ||
| # checkout is only the trigger vehicle. The deploy acts on /opt/agrippa, which | ||
| # is root-owned and holds the untracked .env. See docs/design/08-deployment.md | ||
| # for why the tree is not janus-writable. | ||
| name: deploy | ||
|
|
||
| on: | ||
| push: | ||
| branches: [deploy] | ||
|
|
||
| # Serialize deploys. infra/deploy.sh also takes a flock, which covers manual | ||
| # runs that never reach Janus; this stops the queue forming inside the script. | ||
| concurrency: | ||
| group: deploy-${{ branch }} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| steps: | ||
| # Passing the exact SHA makes the deploy deterministic: it applies the | ||
| # commit that triggered this run, not whatever the branch tip has moved | ||
| # to since. sudo is a single NOPASSWD rule for this one script. | ||
| - run: sudo /opt/agrippa/infra/deploy.sh ${{ sha }} |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.