Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| devops:ci [2022-03-22 10:22] – created Robbert Hofman | devops:ci [2022-09-02 16:04] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Continuous Integration (CI) ====== | ====== Continuous Integration (CI) ====== | ||
| + | ===== Introduction ===== | ||
| The basic idea of CI is that whenever you push a commit, tests start running automatically on some server. \\ | The basic idea of CI is that whenever you push a commit, tests start running automatically on some server. \\ | ||
| If the tests pass, you have a bit more confidence that the code that you pushed doesn' | If the tests pass, you have a bit more confidence that the code that you pushed doesn' | ||
| Line 10: | Line 10: | ||
| + | ===== 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. \\ | ||
| + | As we know, there are 2 main ways to do that: over HTTPS (user/ | ||
| + | In our case, the rosinstall files are defined using SSH (git@someurl), | ||
| + | |||
| + | === SSH === | ||
| + | Best practice is to use [[https:// | ||
| + | |||
| + | === HTTPS === | ||
| + | You can use the environment variable $CI_JOB_TOKEN for free. It's included. You don't have to do anything. | ||
| + | <code yaml> | ||
| + | some_early_stage: | ||
| + | script: | ||
| + | - git clone https:// | ||
| + | </ | ||
| + | |||
| + | ==== 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 '' | ||
| + | <code yaml> | ||
| + | trigger-main: | ||
| + | trigger: | ||
| + | project: robotlab/ | ||
| + | branch: main | ||
| + | strategy: depend | ||
| + | </ | ||
| + | I learned that here: https:// | ||