Mesa (master): gitlab-ci: Extend .ci-run-policy template for docs jobs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 1 14:58:31 UTC 2020


Module: Mesa
Branch: master
Commit: 8e2cb8ef276beb0da00d60961735449aa341be7e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e2cb8ef276beb0da00d60961735449aa341be7e

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Mon Jun 22 11:21:06 2020 +0200

gitlab-ci: Extend .ci-run-policy template for docs jobs

Requires using rules: in the pages job as well, so it doesn't inherit
the rules from the template.

v2:
* Add comment explaining that cases not covered by explicit rules
  default to "when: never".

Reviewed-by: Daniel Stone <daniels at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5469>

---

 .gitlab-ci.yml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 227a27d9bb6..a12b9dae013 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,6 +25,7 @@ stages:
   - success
 
 .docs-base:
+  extends: .ci-run-policy
   image: alpine
   script:
   - apk --no-cache add py3-pip
@@ -37,12 +38,13 @@ pages:
   artifacts:
     paths:
     - public
-  only:
-    refs:
-    - master at mesa/mesa
-    changes:
-    - docs/**/*
-    - .gitlab-ci.yml
+  rules:
+    - if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"'
+      changes: &docs-or-ci
+      - docs/**/*
+      - .gitlab-ci.yml
+      when: on_success
+    # Other cases default to never
 
 test-docs:
   extends: .docs-base
@@ -51,9 +53,7 @@ test-docs:
     - if: '$CI_PROJECT_NAMESPACE == "mesa"'
       when: never
     - if: '$GITLAB_USER_LOGIN == "marge-bot"'
-      changes: &docs-or-ci
-      - docs/**/*
-      - .gitlab-ci.yml
+      changes: *docs-or-ci
       when: on_success
     - changes: *docs-or-ci
       when: manual



More information about the mesa-commit mailing list