Appearance
GitLab
Source code repositories are managed via a self-hosted GitLab instance at https://gitlab.morphsites.net.
Rationale
While self-hosting GitLab incurs some operations overhead, it has a number of advantages:
- Source code is not handed over to a third party
- Much cheaper to run CI/CD pipelines
- Mitigates the impact of GitHub outages
Implementation
GitLab runs via Docker Compose on a single Linode VPS. This also includes job runners for CI/CD and GitLab's Composer and Docker registries.
GitLab is proxied by Cloudflare for DDoS and WAF protection.
Configuration is stored in a GitHub repository: https://github.com/morphsites-limited/gitlab. Further information may be found in the project readme.
Configuration changes
Configuration changes may be made live on the GitLab server when needed, but all changes must be committed to the main branch of the repository.
Upgrade procedure
GitLab upgrades should be performed out of hours around once a month, or as needed to receive security patches.
Procedure:
shell
ssh gitlab.morphsites.net
sudo su morph
cd /home/morph/gitlab
docker compose pull
docker compose down
docker compose upIt can take several minutes for the gitlab container to fully boot and the upgrade to complete.
TIP
Omitting the -d flag on docker compose up will give you a live view of the logs. Hit the d key to detach and leave the containers running.