* [Buildroot] [PATCH] gitlab-ci: convert only/except to rules
@ 2020-07-18 15:47 Romain Naour
2020-07-20 8:44 ` Arnout Vandecappelle
2020-08-13 9:44 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Romain Naour @ 2020-07-18 15:47 UTC (permalink / raw)
To: buildroot
only/except keywords will be deprecated by upcoming gitlab release,
upstream recommend to use rules keyword instead [1][2][3][4][5].
This patch convert .gitlab-ci.yml to use rules, no functional
changes intended.
After this patch, we should still have the following behaviour
while pushing commit, tag, branches:
- to trigger only the check-* jobs:
$ git push gitlab HEAD:<name>
- to trigger all defconfigs and all check-* jobs:
$ git push gitlab HEAD:<name>-defconfigs
- to trigger all runtime tests and all check-* jobs:
$ git push gitlab HEAD:<name>-runtime-tests
- to trigger one defconfig job:
$ git push gitlab HEAD:<name>-<defconfig name>
- to trigger one runtime job:
$ git push gitlab HEAD:<name>-<test case name>
[1] https://gitlab.com/gitlab-org/gitlab/-/commit/7eaaa597e24bf24743bdd8f8d1d51ade83b3f6de
[2] https://about.gitlab.com/releases/2020/06/22/gitlab-13-1-released/#templates-to-simplify-initial-rules-keyword-configuration
[3] https://about.gitlab.com/releases/2020/05/22/gitlab-13-0-released/#auto-devops-and-secure-configuration-templates-are-changing-to-%60rules%60-instead-of-%60only/except%60
[4] https://gitlab.com/gitlab-org/gitlab/issues/27449
[5] https://gitlab.com/groups/gitlab-org/-/epics/2783
[6] https://buildroot.org/downloads/manual/manual.html#_using_the_run_tests_framework
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
.gitlab-ci.yml | 38 +++++++++++++++++++++++---------------
.gitlab-ci.yml.in | 38 +++++++++++++++++++++++---------------
2 files changed, 46 insertions(+), 30 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 673aa8b3e7..1ccb1b282b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,9 +7,10 @@
image: buildroot/base:20191027.2027
.check_base:
- except:
- - /^.*-.*_defconfig$/
- - /^.*-tests\..*$/
+ rules:
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/ || $CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
+ when: never
+ - when: always
check-DEVELOPERS:
extends: .check_base
@@ -76,17 +77,21 @@ check-package:
extends: .defconfig_base
# Running the defconfigs for every push is too much, so limit to
# explicit triggers through the API.
- only:
- - triggers
- - tags
- - /-defconfigs$/
+ rules:
+ # For tags, create a pipeline.
+ - if: '$CI_COMMIT_TAG'
+ # For pipeline created by using a trigger token.
+ - if: '$CI_PIPELINE_TRIGGERED'
+ # For the branch or tag name named *-defconfigs, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-defconfigs$/'
before_script:
- DEFCONFIG_NAME=${CI_JOB_NAME}
one-defconfig:
extends: .defconfig_base
- only:
- - /^.*-.*_defconfig$/
+ rules:
+ # For the branch or tag name named *-*_defconfigs, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/'
before_script:
- DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
@@ -110,17 +115,20 @@ one-defconfig:
extends: .runtime_test_base
# Running the runtime tests for every push is too much, so limit to
# explicit triggers through the API.
- only:
- - triggers
- - tags
- - /-runtime-tests$/
+ rules:
+ # For tags, create a pipeline.
+ - if: '$CI_COMMIT_TAG'
+ # For pipeline created by using a trigger token.
+ - if: '$CI_PIPELINE_TRIGGERED'
+ # For the branch or tag name named *-runtime-tests, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-runtime-tests$/'
before_script:
- TEST_CASE_NAME=${CI_JOB_NAME}
one-runtime_test:
extends: .runtime_test_base
- only:
- - /^.*-tests\..*$/
+ rules:
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
before_script:
- TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
aarch64_efi_defconfig: { extends: .defconfig }
diff --git a/.gitlab-ci.yml.in b/.gitlab-ci.yml.in
index 6b09730a65..1facd2a66f 100644
--- a/.gitlab-ci.yml.in
+++ b/.gitlab-ci.yml.in
@@ -7,9 +7,10 @@
image: buildroot/base:20191027.2027
.check_base:
- except:
- - /^.*-.*_defconfig$/
- - /^.*-tests\..*$/
+ rules:
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/ || $CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
+ when: never
+ - when: always
check-DEVELOPERS:
extends: .check_base
@@ -76,17 +77,21 @@ check-package:
extends: .defconfig_base
# Running the defconfigs for every push is too much, so limit to
# explicit triggers through the API.
- only:
- - triggers
- - tags
- - /-defconfigs$/
+ rules:
+ # For tags, create a pipeline.
+ - if: '$CI_COMMIT_TAG'
+ # For pipeline created by using a trigger token.
+ - if: '$CI_PIPELINE_TRIGGERED'
+ # For the branch or tag name named *-defconfigs, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-defconfigs$/'
before_script:
- DEFCONFIG_NAME=${CI_JOB_NAME}
one-defconfig:
extends: .defconfig_base
- only:
- - /^.*-.*_defconfig$/
+ rules:
+ # For the branch or tag name named *-*_defconfigs, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/'
before_script:
- DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
@@ -110,16 +115,19 @@ one-defconfig:
extends: .runtime_test_base
# Running the runtime tests for every push is too much, so limit to
# explicit triggers through the API.
- only:
- - triggers
- - tags
- - /-runtime-tests$/
+ rules:
+ # For tags, create a pipeline.
+ - if: '$CI_COMMIT_TAG'
+ # For pipeline created by using a trigger token.
+ - if: '$CI_PIPELINE_TRIGGERED'
+ # For the branch or tag name named *-runtime-tests, create a pipeline.
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-runtime-tests$/'
before_script:
- TEST_CASE_NAME=${CI_JOB_NAME}
one-runtime_test:
extends: .runtime_test_base
- only:
- - /^.*-tests\..*$/
+ rules:
+ - if: '$CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
before_script:
- TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
--
2.25.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] gitlab-ci: convert only/except to rules
2020-07-18 15:47 [Buildroot] [PATCH] gitlab-ci: convert only/except to rules Romain Naour
@ 2020-07-20 8:44 ` Arnout Vandecappelle
2020-08-13 9:44 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2020-07-20 8:44 UTC (permalink / raw)
To: buildroot
On 18/07/2020 17:47, Romain Naour wrote:
> only/except keywords will be deprecated by upcoming gitlab release,
> upstream recommend to use rules keyword instead [1][2][3][4][5].
>
> This patch convert .gitlab-ci.yml to use rules, no functional
> changes intended.
>
> After this patch, we should still have the following behaviour
> while pushing commit, tag, branches:
>
> - to trigger only the check-* jobs:
> $ git push gitlab HEAD:<name>
>
> - to trigger all defconfigs and all check-* jobs:
> $ git push gitlab HEAD:<name>-defconfigs
>
> - to trigger all runtime tests and all check-* jobs:
> $ git push gitlab HEAD:<name>-runtime-tests
>
> - to trigger one defconfig job:
> $ git push gitlab HEAD:<name>-<defconfig name>
>
> - to trigger one runtime job:
> $ git push gitlab HEAD:<name>-<test case name>
>
> [1] https://gitlab.com/gitlab-org/gitlab/-/commit/7eaaa597e24bf24743bdd8f8d1d51ade83b3f6de
> [2] https://about.gitlab.com/releases/2020/06/22/gitlab-13-1-released/#templates-to-simplify-initial-rules-keyword-configuration
> [3] https://about.gitlab.com/releases/2020/05/22/gitlab-13-0-released/#auto-devops-and-secure-configuration-templates-are-changing-to-%60rules%60-instead-of-%60only/except%60
> [4] https://gitlab.com/gitlab-org/gitlab/issues/27449
> [5] https://gitlab.com/groups/gitlab-org/-/epics/2783
> [6] https://buildroot.org/downloads/manual/manual.html#_using_the_run_tests_framework
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
I'm still impressed with how elegant this solution with branch names is!
Regards,
Arnout
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] gitlab-ci: convert only/except to rules
2020-07-18 15:47 [Buildroot] [PATCH] gitlab-ci: convert only/except to rules Romain Naour
2020-07-20 8:44 ` Arnout Vandecappelle
@ 2020-08-13 9:44 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-08-13 9:44 UTC (permalink / raw)
To: buildroot
>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:
> only/except keywords will be deprecated by upcoming gitlab release,
> upstream recommend to use rules keyword instead [1][2][3][4][5].
> This patch convert .gitlab-ci.yml to use rules, no functional
> changes intended.
> After this patch, we should still have the following behaviour
> while pushing commit, tag, branches:
> - to trigger only the check-* jobs:
> $ git push gitlab HEAD:<name>
> - to trigger all defconfigs and all check-* jobs:
> $ git push gitlab HEAD:<name>-defconfigs
> - to trigger all runtime tests and all check-* jobs:
> $ git push gitlab HEAD:<name>-runtime-tests
> - to trigger one defconfig job:
> $ git push gitlab HEAD:<name>-<defconfig name>
> - to trigger one runtime job:
> $ git push gitlab HEAD:<name>-<test case name>
> [1] https://gitlab.com/gitlab-org/gitlab/-/commit/7eaaa597e24bf24743bdd8f8d1d51ade83b3f6de
> [2] https://about.gitlab.com/releases/2020/06/22/gitlab-13-1-released/#templates-to-simplify-initial-rules-keyword-configuration
> [3] https://about.gitlab.com/releases/2020/05/22/gitlab-13-0-released/#auto-devops-and-secure-configuration-templates-are-changing-to-%60rules%60-instead-of-%60only/except%60
> [4] https://gitlab.com/gitlab-org/gitlab/issues/27449
> [5] https://gitlab.com/groups/gitlab-org/-/epics/2783
> [6] https://buildroot.org/downloads/manual/manual.html#_using_the_run_tests_framework
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
Committed to 2020.02.x and 2020.05.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-13 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-18 15:47 [Buildroot] [PATCH] gitlab-ci: convert only/except to rules Romain Naour
2020-07-20 8:44 ` Arnout Vandecappelle
2020-08-13 9:44 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.