From a commit to prod
The full path of a change, from your machine to the users. Only two actions are human: merging into develop, then merging into main.
Step by step
| # | Who | What | What happens | Where to look |
|---|---|---|---|---|
| 1 | you | push to feature/x | *:lint and *:test of the changed part | Build → Pipelines |
| 2 | you | merge request to develop | the pipeline and tests show in the MR | the MR |
| 3 | a reviewer | merges | develop pipeline: lint, tests, image build, deploy-dev | Operate → Environments → dev |
| 4 | you | check on https://dev.trinity.jostud.com | — | the dev site |
| 5 | you | merge request develop → main | — | the MR |
| 6 | a reviewer | merges | main pipeline: lint, tests, build, deploy-prod with zero downtime | Operate → Environments → prod |
How long? A few minutes per pipeline: the longest jobs are the image builds.
How to know what is in prod
- Operate → Environments → prod: the latest deployment and its commit.
- On the server:
docker service lsshows each service's image, hence its SHA.
Rolling back
Three ways, from simplest to most manual:
| Method | When |
|---|---|
| Nothing to do | the new version fails its health check: Swarm goes back to the old one on its own |
| Operate → Environments → prod → Re-deploy on an older deployment | the new version passes the health check but has a bug |
git revert the faulty commit, then merge request up to main | so the fix stays in the history |
The details are in If the site goes down.
A rollback does not undo a migration
See Database.