This is an old revision of the document!
GitLab
Documentation
Des docs que je galère à retouver à chaque fois et/ou dont je me sers/parle souvent.
CI/CD :
CLI tools
| Project | Language | CLI | Interactive shell |
|---|---|---|---|
| https://github.com/profclems/glab | Go | ✔ | ✔✔ |
| https://metacpan.org/release/GitLab-API-v4 | Perl | ✔ | ✘ |
| https://github.com/python-gitlab/python-gitlab | Python | ✔ | ✘ |
| https://github.com/narkoz/gitlab | Ruby | ✔ | ✘ |
Awesome Pipelines
GitLab CI/CD Examples right from the doc.
Docker
- The shiny pipeline.yml file from the pipeline-components project.
- https://about.gitlab.com/images/13_3/cartesian-matrix.png : Best Practices blog post, including a Drop-in simple Docker CI.
Misc
- The Debian salsa-ci-team/pipeline project
GitLabForm
Long term goal: use https://github.com/egnyte/gitlabform !
Des trucs à faire, voir, explorer, penser:
- Un webhook sur
project_createpour faire un coup de sed direct, pour changer les{{IMAGENAME}}et autres{{DEFAULT_COMMAND}}.
Docs and pointers:
- https://docs.gitlab.com/ee/development/cicd/templates.html Premium/Gold only :(
Todo/Explore/etc
Parent-Child Pipelines
Doc
Examples
(fr) https://blog.ippon.fr/2020/07/31/construire-la-ci-dun-monorepo-les-parent-child-pipelines-de-gitlab-ci/: monorepo pipelines:
- root CI triggers sub-folders' pipelines
- android/ builds
- iOS/ builds
- backend/ builds
- what about a QA job that tests everything?
https://zerotoprod.com/posts/gitlab-ci-advanced/: back and forth multiple projects pipelines:
- project1 builds ⇒ triggers project2's test job.
- Project2 tests ⇒ triggers back project1's deploy job.
- Project1 deploys ⇒ triggers Project2's QA's job.
- Project2 does QA.
Matrix
- documentation in the
.gitlab-ci.yml Reference
deploystacks: stage: deploy script: - bin/deploy parallel: matrix: - PROVIDER: aws STACK: - monitoring - app1 - app2 - PROVIDER: ovh STACK: [monitoring, backup, app] - PROVIDER: [gcp, vultr] STACK: [data, processing]
python-gitlab cheatsheet
A wrapper with bash-completion:
- /usr/local/bin/gitlab-python
#!/bin/sh # bash completion /home/tom/.virtualenv/python-gitlab/bin/register-python-argcomplete $( basename $0 ) | bash - # wrapper /home/tom/.virtualenv/python-gitlab/bin/python /home/tom/.virtualenv/python-gitlab/bin/gitlab "$@"
git pull all projects from a group:
gitlab-python -o json \ group-project list \ --all --include-subgroups true \ --group-id 9969158 | jq -r '.[].ssh_url_to_repo' \ | xargs ghq get
