Skip to content

gitlab-ci: handle all conditional jobs in the generating script (branch yem/gitlab-ci-cond)

Yann E. MORIN buildroot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10gitlab-ci: introduce main() in generating scriptsupport/scripts/generate-gitlab-ci-yml+11 -71 reply
2/10gitlab-ci: share the image version with the childsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+13 -61 reply
3/10gitlab-ci: handle the defconfig build conditions in scriptsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+29 -141 reply
4/10gitlab-ci: defconfig_check is included in defconfig buildsupport/scripts/generate-gitlab-ci-yml+2 -11 reply
5/10gitlab-ci: handle the run-time tests conditions in scriptsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+29 -131 reply
5/10gitlab-ci: handle the run-time tests conditions in script+0 -00 replies
6/10gitlab-ci: handle single defconfig in scriptsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+7 -121 reply
7/10gitlab-ci: handle single runtime test in scriptsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+7 -101 reply
8/10gitlab-ci: handle the basic tests in scriptsupport/misc/gitlab-ci.yml.in support/scripts/generate-gitlab-ci-yml+22 -141 reply
9/10gitlab-ci: move before-script before scriptsupport/misc/gitlab-ci.yml.in+6 -61 reply
10/10gitlab-ci: only check defconfigs for known branchessupport/scripts/generate-gitlab-ci-yml+16 -131 reply

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by.

PatchRomain Naour
1/10R-b
2/10R-b
3/10R-b
4/10A-b
5/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Buildroot] [PATCH 00/10] gitlab-ci: handle all conditional jobs in the generating script (branch yem/gitlab-ci-cond)

Hello All!

The grammar in gitlab-CI yaml, to specify conditions under which jobs should be spawned or not, is not very nice to handle.

Take adavantage of the fact that we are now generating the pipeline description from a script, to decide in that script exactly what jobs should be spawned.

This is both more usual, to use a classic scripting language (shell for now, but could be whatever in the future), and more versatile (we can more easilt express conditions than in the limited gitlab-CI YAML).

Here are examples of resulting pipelines, with child pipelines created under the various expected conditions:

Arbitrary branch, only run the basic tests:
git push gitlab
https://gitlab.com/ymorin/buildroot/-/pipelines/186557459

Maintenance branch, run the basic checks, and check the defconfigs:
git push gitlab HEAD:toto.no.x
https://gitlab.com/ymorin/buildroot/-/pipelines/186556538

Tag, run all the tests:
git tag FOO-YEM
git push gitlab FOO-YEM
https://gitlab.com/ymorin/buildroot/-/pipelines/186559009

Build all defconfigs:
git push gitlab HEAD:FOO-defconfigs
https://gitlab.com/ymorin/buildroot/-/pipelines/186551495

Build one defconfig:
git push gitlab HEAD:FOO-warp7_defconfig
https://gitlab.com/ymorin/buildroot/-/pipelines/186530844

Build all runtime tests:
git push gitlab HEAD:FOO-runtime-tests
https://gitlab.com/ymorin/buildroot/-/pipelines/186554657

Build one runtime test:
git push gitlab HEAD:FOO-tests.package.test_openssh
https://gitlab.com/ymorin/buildroot/-/pipelines/186530918

Notes:
- 'gitlab' is my git remote pointing to gitlab,
- some pipelines were canceled to not exhaust my job limit
- there were too many jobs in the tag, so it exceed the limits of my free account...

Regards,
Yann E. MORIN.

The following changes since commit 97d431c181268716b38cd5a63eb0e8b78b003b3b

package/mrp: new package (2020-09-06 16:38:02 +0200)

are available in the git repository at:

https://git.busybox.net/~ymorin/git/buildroot

for you to fetch changes up to c1ea91abce5dbf7068615b247ff77dd7f8ec8fbb

gitlab-ci: only check defconfigs for known branches (2020-09-06 21:59:52 +0200)

----------------------------------------------------------------
Yann E. MORIN (10):
gitlab-ci: introduce main() in generating script
gitlab-ci: share the image version with the child
gitlab-ci: handle the defconfig build conditions in script
gitlab-ci: defconfig_check is included in defconfig build
gitlab-ci: handle the run-time tests conditions in script
gitlab-ci: handle single defconfig in script
gitlab-ci: handle single runtime test in script
gitlab-ci: handle the basic tests in script
gitlab-ci: move before-script before script
gitlab-ci: only check defconfigs for known branches

 support/misc/gitlab-ci.yml.in          |  70 +++----------------
 support/scripts/generate-gitlab-ci-yml | 118 ++++++++++++++++++++++++++++++---
 2 files changed, 117 insertions(+), 71 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'