Table of Contents

GitLab

Documentation

Des docs que je galère à retouver à chaque fois et/ou dont je me sers/parle souvent.

CI/CD :

CLI tools

Project What Language CLI Interactive shell
https://github.com/profclems/glab CLI Go ✔ ✔✔
https://metacpan.org/release/GitLab-API-v4 CLI Perl ✔ ✘
https://github.com/python-gitlab/python-gitlab CLI Python ✔ ✘
https://github.com/narkoz/gitlab CLI Ruby ✔ ✘
https://github.com/michaellihs/golab CLI Go ✔ ✘
https://gitlab.com/AdrianDC/gitlabci-local Local runner Python ✔ ✔

Awesome Pipelines

GitLab CI/CD Examples right from the doc.

Docker

Misc

GitLabForm

Long term goal: use https://github.com/egnyte/gitlabform !

Des trucs à faire, voir, explorer, penser:

Docs and pointers:

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:

https://zerotoprod.com/posts/gitlab-ci-advanced/: back and forth multiple projects pipelines:

Matrix

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]

Combination of Architectures, Environments, Versions.

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