[OS-BUILD PATCHv12 13/14] Simplify job rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Hofmann <mhofmann@xxxxxxxxxx>

Simplify job rules

- enable head pipelines in workflow rules
- always run docs/pages jobs on os-build head pipelines
- always run test_docs job on os-build MR pipelines

Signed-off-by: Michael Hofmann <mhofmann@xxxxxxxxxx>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index blahblah..blahblah 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,13 +20,24 @@ default:
 
 workflow:
   rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'   # ARK release pipelines
-    - if: '$CI_MERGE_REQUEST_PROJECT_PATH =~ /^cki-project.kernel-ark/'   # ARK MR CI
+    # ARK release pipelines
+    - if: '$CI_PIPELINE_SOURCE == "schedule"'
+    # HEAD pipelines
+    - if: $CI_PIPELINE_SOURCE =~ /push|web/ &&
+          $CI_PROJECT_PATH =~ /^cki-project.kernel-ark/
+    # merge requests
+    - if: $CI_MERGE_REQUEST_PROJECT_PATH =~ /^cki-project.kernel-ark/
 
 .rules:
-  only-os-build: &only-os-build
+  only-os-build-mr: &only-os-build-mr
     if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "os-build"
     when: never
+  only-os-build-head: &only-os-build-head
+    if: $CI_COMMIT_BRANCH != "os-build" || $CI_PIPELINE_SOURCE !~ /push|web/
+    when: never
+  only-os-build-schedule: &only-os-build-schedule
+    if: $CI_COMMIT_BRANCH != "os-build" || $CI_PIPELINE_SOURCE != "schedule"
+    when: never
   on-success: &on-success
     when: on_success
   manual-for-bot: &manual-for-bot
@@ -73,13 +84,13 @@ workflow:
 
 .srpm_for_bot:
   rules:
-    - *only-os-build
+    - *only-os-build-mr
     - *srpm-for-bot
     - *on-success
 
 .manual_for_bot:
   rules:
-    - *only-os-build
+    - *only-os-build-mr
     - *manual-for-bot
     - *on-success
 
@@ -174,9 +185,9 @@ merge_upstream:
     - make dist-merge-upstream-push || exit 1
   retry: 2
   rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule" && $RAWHIDE_RELEASE == "false"'
+    - *only-os-build-schedule
+    - if: $RAWHIDE_RELEASE == "false"
 
-# scheduled job
 rawhide_release:
   extends: .scheduled_setup
   script:
@@ -196,7 +207,8 @@ rawhide_release:
     - git push -f gitlab ark-infra
   retry: 2
   rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule" && $RAWHIDE_RELEASE == "true"'
+    - *only-os-build-schedule
+    - if: $RAWHIDE_RELEASE == "true"
 
 test_makefile:
   image: quay.io/fedora/fedora:rawhide
@@ -217,7 +229,8 @@ test_makefile:
     - export missingafter=$(make dist-get-buildreqs | grep "Missing dependencies:" | cut -d":" -f2)
     - if [ "$missingafter" != "" ]; then echo "Missing dependencies should be null but are $missingafter. Review test log." && exit 1; fi;
   rules:
-    - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "os-build"'
+    - *only-os-build-mr
+    - *on-success
 
 test_docs:
   stage: test
@@ -229,10 +242,8 @@ test_docs:
     - cd redhat/docs/
   script: make SPHINXOPTS="-W" html
   rules:
-    - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "os-build"'
-      changes:
-        - redhat/docs/**/*
-
+    - *only-os-build-mr
+    - *on-success
 
 docs:
   stage: build
@@ -247,9 +258,8 @@ docs:
     paths:
       - redhat/docs/_build/html/
   rules:
-    - if: '$CI_COMMIT_BRANCH == "os-build"'
-      changes:
-        - redhat/docs/**/*
+    - *only-os-build-head
+    - *on-success
 
 pages:
   stage: deploy
@@ -262,6 +272,5 @@ pages:
     paths:
       - public
   rules:
-    - if: '$CI_COMMIT_BRANCH == "os-build"'
-      changes:
-        - redhat/docs/**/*
+    - *only-os-build-head
+    - *on-success

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2575
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux