devops:ci

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
devops:ci [2022/03/22 09:49] robberthdevops:ci [2022/09/02 14:04] (current) – external edit 127.0.0.1
Line 11: Line 11:
  
 ===== Authorization to clone git repos ===== ===== Authorization to clone git repos =====
-Just like a normal git user, the CI pipeline also needs to prove it has the authority to clone a repository. +Just like a normal git user, the CI pipeline also needs to prove it has the authority to clone a repository. \\ 
-As we know, there are 2 main ways to do that: over HTTPS (user/password), or over SSH (private/public key). +As we know, there are 2 main ways to do that: over HTTPS (user/password), or over SSH (private/public key). \\ 
-In our case, the rosinstall files are defined using SSH (git@someurl), so that is what's used in the CI as well.+In our case, the rosinstall files are defined using SSH (git@someurl), so that is what's used in the CI as well. \\
  
 === SSH === === SSH ===
-Best practice would be to use [[https://docs.gitlab.com/ee/user/project/deploy_keys/index.html|deploy keys]] and put the private key in the [[https://docs.gitlab.com/ee/ci/variables/index.html#add-a-cicd-variable-to-a-project|CI variables]].+Best practice is to use [[https://docs.gitlab.com/ee/user/project/deploy_keys/index.html|deploy keys]] and put the private key in the [[https://docs.gitlab.com/ee/ci/variables/index.html#add-a-cicd-variable-to-a-project|CI variables]]. This is what we are doing.
  
 === HTTPS === === HTTPS ===
 You can use the environment variable $CI_JOB_TOKEN for free. It's included. You don't have to do anything. You can use the environment variable $CI_JOB_TOKEN for free. It's included. You don't have to do anything.
-<code>+<code yaml>
 some_early_stage: some_early_stage:
   script:   script:
Line 26: Line 26:
 </code> </code>
  
 +==== Propagating CI triggers ====
 +We want the main pipeline to be triggered if a commit happens in ANY of the repositories that the pipeline depends on. \\
 +This can be achieved by putting the following ''.gitlab-ci.yml'' in each of those repos, in the right branch of course (i.e. the branch the pipeline uses).
 +<code yaml>
 +trigger-main:
 +  trigger: 
 +    project: robotlab/heron/heron-ci
 +    branch: main
 +    strategy: depend
 +</code>
 +I learned that here: https://docs.gitlab.com/ee/ci/pipelines/multi_project_pipelines.html
  • devops/ci.1647942582.txt.gz
  • Last modified: 2022/09/02 14:04
  • (external edit)