summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrew <dscimino@gmail.com>2019-08-21 07:15:43 +0000
committerEvan Read <eread@gitlab.com>2019-08-21 07:15:43 +0000
commitcdabb9d5b6f44016fbe61979d3338add34fc9956 (patch)
tree36ea6ae174a98c1657792c3ce73381fbe3560f8b
parentdb8f391e24b9ae8a8f49c682d9fabf05a66291b8 (diff)
downloadgitlab-ce-cdabb9d5b6f44016fbe61979d3338add34fc9956.tar.gz
Added an example to doumentation for using multiple build policies with only: and except:
-rw-r--r--doc/ci/yaml/README.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 335f3292444..c957ed2cc6b 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -518,10 +518,24 @@ Four keys are available:
- `changes`
- `kubernetes`
-If you use multiple keys under `only` or `except`, they act as an AND. The logic is:
+If you use multiple keys under `only` or `except`, the keys will be evaluated as a
+single conjoined expression. That is:
+
+- `only:` means "include this job if all of the conditions match".
+- `except:` means "exclude this job if any of the conditions match".
+
+The the individual keys are logically joined by an AND:
> (any of refs) AND (any of variables) AND (any of changes) AND (if kubernetes is 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))
+
+This, more intuitively, means the keys join by an OR. A functionally equivalent expression:
+
+> (any of refs) OR (any of variables) OR (any of changes) OR (if kubernetes is active)
+
#### `only:refs`/`except:refs`
> `refs` policy introduced in GitLab 10.0.