gitlab:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gitlab:start [2020/11/01 15:57] – tomgitlab:start [2022/03/20 15:25] (current) – [Documentation] tom
Line 1: Line 1:
 ====== GitLab ====== ====== GitLab ======
 +
 +===== Documentation =====
 +
 +Des docs que je galère à retouver à chaque fois et/ou dont je me sers/parle souvent.
 +
 +CI/CD :
 +
 +  * La [[https://docs.gitlab.com/ee/user/gitlab_com/index.html|configuration spécifique à l'instance SaaS GitLab.com]] et [[https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html#configtoml|celle des Runners Saas]].
 +
 +  * [[https://docs.gitlab.com/ee/user/project/integrations/webhooks.html|Webhooks]]
 +
  
 ===== CLI tools ===== ===== CLI tools =====
  
-  * [[https://github.com/profclems/glab]] +^ Project ^ What  ^  Language  ^  CLI  ^  Interactive shell  ^ 
-  * https://metacpan.org/release/GitLab-API-v4 +| [[https://github.com/profclems/glab]] | CLI |  Go  |  ✔  |  ✔✔  | 
-  * https://github.com/python-gitlab/python-gitlab && https://python-gitlab.readthedocs.io/en/stable/cli.html +| https://metacpan.org/release/GitLab-API-v4 | CLI |  Perl  |  ✔  |  ✘  | 
-  * https://github.com/narkoz/gitlab+| 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 ===== ===== Awesome Pipelines =====
  
-To infinite and beyond: [[https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml|GitLab's onw pipeline]]. +[[https://docs.gitlab.com/ee/ci/examples/README.html|GitLab CI/CD Examples]] right from the doc.
- +
-Also, [[https://docs.gitlab.com/ee/ci/examples/README.html|GitLab CI/CD Examples]] right from the doc.+
  
 ==== Docker ==== ==== Docker ====
 +
   * The shiny [[https://gitlab.com/pipeline-components/org/config/-/blob/master/pipeline.yml|pipeline.yml]] file from the [[https://pipeline-components.dev/|pipeline-components]] project.   * The shiny [[https://gitlab.com/pipeline-components/org/config/-/blob/master/pipeline.yml|pipeline.yml]] file from the [[https://pipeline-components.dev/|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 ==== ==== Misc ====
 +
   * The Debian [[https://salsa.debian.org/salsa-ci-team/pipeline|salsa-ci-team/pipeline]] project   * The Debian [[https://salsa.debian.org/salsa-ci-team/pipeline|salsa-ci-team/pipeline]] project
 +  * To infinite and beyond: [[https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml|GitLab's own pipeline]] - even the [[https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/rules.gitlab-ci.yml|rules files]] is ~1500 lines long 8-O
 +
 +===== GitLabForm =====
 +
 +Long term goal: use https://github.com/egnyte/gitlabform !
 +
 +Des trucs à faire, voir, explorer, penser:
 +
 +  * Un webhook sur ''project_create'' pour faire un coup de sed direct, pour changer les ''<nowiki>{{IMAGENAME}}</nowiki>'' et autres ''<nowiki>{{DEFAULT_COMMAND}}</nowiki>''.
 +
 +Docs and pointers:
 +
 +  * https://docs.gitlab.com/ee/development/cicd/templates.html Premium/Gold only :(
 +  * https://docs.gitlab.com/ee/user/project/settings/import_export.html
  
 ===== Todo/Explore/etc ===== ===== Todo/Explore/etc =====
  
-  * [[https://wes.today/building-multi-arch-docker-images|Multi-architecture Docker images builds]]+  * [[https://web.archive.org/web/20201201114733/https://wes.today/building-multi-arch-docker-images|Multi-architecture Docker images builds]] 
 +    * [[https://www.docker.com/blog/multi-arch-build-what-about-gitlab-ci/|Pareil mais avec une image buildx pré-construite]] 8-) qu'on trouve sur [[https://github.com/jdrouet/docker-with-buildx/blob/master/Dockerfile|jdrouet/docker-with-buildx]] 8-) 
 +==== Parent-Child Pipelines ==== 
 + 
 +=== Doc === 
 + 
 +  * https://docs.gitlab.com/ee/ci/multi_project_pipelines.html 
 + 
 +=== 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. 
 +  * m( 
 + 
 +==== Matrix ==== 
 + 
 +  * [[https://about.gitlab.com/releases/2020/08/22/gitlab-13-3-released/#create-a-matrix-of-jobs-using-a-simple-syntax|Blog announce]] 
 +  * [[https://docs.gitlab.com/ee/ci/yaml/#parallel-matrix-jobs|documentation]] in the ''.gitlab-ci.yml Reference'' 
 + 
 +<WRAP 45% left> 
 +<code yaml> 
 +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] 
 +</code> 
 +</WRAP> 
 +<WRAP 47% right> 
 +{{https://about.gitlab.com/images/13_3/cartesian-matrix.png|Combination of Architectures, Environments, Versions.}} 
 +</WRAP> 
 + 
 +<WRAP clear></WRAP> 
 +===== python-gitlab cheatsheet ===== 
 + 
 +A wrapper with bash-completion: 
 +<file bash /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 "$@" 
 +</file> 
 + 
 +''git pull'' all projects from a group: 
 + 
 +<code bash> 
 +gitlab-python -o json \ 
 +  group-project list \ 
 +  --all --include-subgroups true \ 
 +  --group-id 9969158 
 +  | jq -r '.[].ssh_url_to_repo' \ 
 +  | xargs ghq get 
 +</code>
  • gitlab/start.1604242623.txt.gz
  • Last modified: 2020/11/01 15:57
  • by tom