]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Deduplicate triggering rules for tag pipeline jobs
authorMichał Kępień <michal@isc.org>
Mon, 27 Oct 2025 04:15:09 +0000 (05:15 +0100)
committerAndoni Duarte Pintado <andoni@isc.org>
Mon, 27 Oct 2025 17:34:53 +0000 (18:34 +0100)
Define and use more YAML anchors for triggering rules commonly used by
tag pipeline jobs.  This builds on top of the work done in commit
675d9c74251fee8ec034e87bdd43e7da97119a5d, improving readability and
reuse.

(cherry picked from commit 0734ec2a68b4a97f9e080096dfd679d5584a265d)

.gitlab-ci.yml

index 737a3ea43adf9798b5eaff6e390ecdd6a2b786d4..8b77cf85b0817ef8a4eeba67969929684c5416eb 100644 (file)
@@ -278,6 +278,12 @@ stages:
 .rule_tag: &rule_tag
   - if: '$CI_PROJECT_NAMESPACE == "isc-private" && $CI_COMMIT_TAG != null'
 
+.rule_tag_open_source: &rule_tag_open_source
+  - if: '$CI_PROJECT_NAMESPACE == "isc-private" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /-S/'
+
+.rule_tag_security_or_subscription: &rule_tag_security_or_subscription
+  - if: '$CI_PROJECT_NAMESPACE == "isc-private" && $CI_COMMIT_TAG != null && ($RELEASE_TYPE == "security" || $CI_COMMIT_TAG =~ /-S/)'
+
 .rule_source_other_than_mr: &rule_source_other_than_mr
   - if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/ && $REBASE_ONLY != "1"'
 
@@ -1665,7 +1671,7 @@ staging:
     - job: sign
       artifacts: true
   rules:
-    - if: '$CI_COMMIT_TAG != null'
+    - *rule_tag
 
 # Job copying a staged release to a secret location
 
@@ -1685,7 +1691,7 @@ publish-private:
     - job: staging
       artifacts: false
   rules:
-    - if: '$CI_COMMIT_TAG != null && ($CI_COMMIT_TAG =~ /-S/ || $RELEASE_TYPE == "security")'
+    - *rule_tag_security_or_subscription
 
 # Job copying a staged release to a well-known location
 
@@ -1702,7 +1708,7 @@ publish:
     - job: staging
       artifacts: false
   rules:
-    - if: '$CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /-S/'
+    - *rule_tag_open_source
 
 # Job creating the release announcement MR in Printing Press
 
@@ -1718,7 +1724,7 @@ prepare-release-announcement:
     - bind9-qa/releng/prepare_release_announcement.py --metadata bind9-qa/releng/metadata.json
   needs: []
   rules:
-    - if: '$CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /-S/'
+    - *rule_tag_open_source
   artifacts:
     paths:
       - printing-press/
@@ -1738,7 +1744,7 @@ merge-tag:
     - bind9-qa/releng/merge_tag.py --tag "$CI_COMMIT_TAG"
   needs: []
   rules:
-    - if: '$CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /-S/'
+    - *rule_tag_open_source
   artifacts:
     paths:
       - bind9/