Folder layout
trinity-devops/
├── .gitlab-ci.yml # root pipeline: stages, includes, deploy-dev, deploy-prod
├── api/.gitlab-ci.yml # api:* jobs (Patrice)
├── web/.gitlab-ci.yml # web:* jobs (Jean-Baptiste)
└── infra/
├── docker-compose.dev.yml # dev: db, api, web built on the spot
├── docker-compose.prod.yml # prod: Swarm stack with registry images
├── traefik/
│ ├── docker-compose.yml # the Traefik container
│ ├── traefik.yml # static config: ports, Let's Encrypt
│ └── dynamic/
│ ├── dev/ # dev server routes
│ │ ├── api.yml
│ │ └── web.yml
│ └── prod/ # prod server routes
│ ├── api.yml
│ └── web.yml
└── ansible/
├── ansible.cfg
├── inventory.ini # the two servers: [dev] and [prod] groups
├── playbook.yml # the 4 roles, in order
├── group_vars/all/
│ ├── main.yml # plain variables
│ └── vault.yml # runner tokens, encrypted
└── roles/
├── docker/ # Docker, Compose, Swarm mode
├── ufw/ # firewall
├── traefik/ # trinity network, files, startup
└── gitlab-runner/ # install and registrationWho reads which file
| File | Read by | When |
|---|---|---|
.gitlab-ci.yml + includes | GitLab | on every push |
docker-compose.dev.yml | the deploy-dev runner | deploy-dev job |
docker-compose.prod.yml | the deploy-prod runner | deploy-prod job |
traefik/* | Ansible, which copies them to /opt/trinity/traefik/ | when the playbook runs |
ansible/* | Ansible, on the administrator's machine | by hand, when a server changes |
Traefik routes are not deployed by the pipeline
Changing infra/traefik/dynamic/ changes nothing live until the Ansible playbook is run again. See Day-to-day operations.