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@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5469>
This commit is contained in:
Michel Dänzer 2020-06-22 11:21:06 +02:00 committed by Marge Bot
parent 1c612e8c09
commit 8e2cb8ef27
1 changed files with 9 additions and 9 deletions

View File

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