summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2020-09-08 12:20:39 +0200
committerMarge Bot <eric+marge@anholt.net>2020-09-21 15:13:03 +0000
commitac56d6699270c0027563c3311fa8a5b418b481d0 (patch)
tree0918b595c20faa3f77cee2ec3e7610660c64de9d /.gitlab-ci.yml
parentc3ae82be247df6d12113b04edc6aa72e7a408119 (diff)
ci: Add "is master branch of main project" YAML anchor
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6566>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml11
1 files changed, 10 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 39e710307ef..1508a33c602 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -40,6 +40,15 @@ stages:
if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
when: never
+# YAML anchors for rule conditions
+# --------------------------------
+.rules-anchors:
+ rules:
+ # Pipeline runs for the master branch of the main project
+ - if: &is-main-master '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"'
+ when: always
+
+
.docs-base:
extends: .ci-run-policy
image: alpine
@@ -56,7 +65,7 @@ pages:
- public
rules:
- *ignore_scheduled_pipelines
- - if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"'
+ - if: *is-main-master
changes: &docs-or-ci
- docs/**/*
- .gitlab-ci.yml