Skip to content

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 registration

Who reads which file ​

FileRead byWhen
.gitlab-ci.yml + includesGitLabon every push
docker-compose.dev.ymlthe deploy-dev runnerdeploy-dev job
docker-compose.prod.ymlthe deploy-prod runnerdeploy-prod job
traefik/*Ansible, which copies them to /opt/trinity/traefik/when the playbook runs
ansible/*Ansible, on the administrator's machineby 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.