changeset 52256:ff1d4b2df8bd stable

ci: abstract the branch matching regexp This is less error prone and make debugging branch-only pipeline simpler.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 15 Nov 2024 00:29:37 +0100
parents d237fdd93eb9
children 3f7c7a855af0
files contrib/heptapod-ci.yml
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/heptapod-ci.yml	Thu Nov 14 16:44:32 2024 +0100
+++ b/contrib/heptapod-ci.yml	Fri Nov 15 00:29:37 2024 +0100
@@ -31,6 +31,14 @@
 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
 
 variables:
+    # to debug use:
+    #
+    #   RE_BRANCH: '/^topic/.+/.+$/'
+    #   RE_TOPIC: '/^xxx/'
+    #
+    # Instead of the two following lines:
+    RE_BRANCH: '/^branch/.+$/'
+    RE_TOPIC: '/^topic/.+/.+$/'
     PYTHON: python
     HG_CI_IMAGE_TAG: "v2.1"
     # a directory dedicated to creating files and temporary clone
@@ -480,7 +488,7 @@
   # because we don't want to upload only half of a wheel
   interruptible: false
   rules:
-    - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/
+    - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH'
       # note that at the time of writing this, this job depends on multiple
       # manual one. So it will not run by default, but will automatically run
       # if the manual jobs are triggered.
@@ -489,7 +497,7 @@
       # directly depends on. This currently relevant for the "test-3.x-c"
       # tests.
       when: on_success
-    - if: $CI_COMMIT_BRANCH =~ /^topic\/.*/
+    - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC'
       when: never
       # if you need to test this, make it
       # when: manual