From 8e2cb8ef276beb0da00d60961735449aa341be7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Mon, 22 Jun 2020 11:21:06 +0200 Subject: [PATCH] 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 Part-of: --- .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@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 -- 2.30.2