diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 09:07:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 09:07:59 +0300 |
commit | f321e51f46bcb628c3e96a44b5ebf3bb1c4033ab (patch) | |
tree | 41a470ff35cd211b308b1b4900935a225f103f32 /doc/ci/yaml | |
parent | 612a849a6cba1765bc41d30d4e931195dcdf64cf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/yaml')
-rw-r--r-- | doc/ci/yaml/README.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 7fbaf5ca0b8..edb311e8e80 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -605,6 +605,24 @@ With `only`, individual keys are logically joined by an AND: > (any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active) +In the example below, the `test` job will `only` be created when **all** of the following are true: + +- The pipeline has been [scheduled](../../user/project/pipelines/schedules.md) **or** runs for `master`. +- The `variables` keyword matches. +- The `kubernetes` service is active on the project. + +```yaml +test: + script: npm run test + only: + refs: + - master + - schedules + variables: + - $CI_COMMIT_MESSAGE =~ /run-end-to-end-tests/ + kubernetes: active +``` + `except` is implemented as a negation of this complete expression: > NOT((any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active)) @@ -613,6 +631,21 @@ This means the keys are treated as if joined by an OR. This relationship could b > (any of refs) OR (any of variables) OR (any of changes) OR (if Kubernetes is active) +In the example below, the `test` job will **not** be created when **any** of the following are true: + +- The pipeline runs for the `master`. +- There are changes to the `README.md` file in the root directory of the repo. + +```yaml +test: + script: npm run test + except: + refs: + - master + changes: + - "README.md" +``` + #### `only:refs`/`except:refs` > `refs` policy introduced in GitLab 10.0. |