summaryrefslogtreecommitdiff
path: root/doc/ci/yaml
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-28 14:00:53 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-28 14:00:53 +0200
commit6ed2370b850ea6db22649ed32940acdc2010877b (patch)
treeadd845cfaf59dfcb460a3ce17c2201f9118ce0cf /doc/ci/yaml
parent4cc4959e3d8c510a8cf3309d2d2d40688501ea6d (diff)
downloadgitlab-ce-6ed2370b850ea6db22649ed32940acdc2010877b.tar.gz
Add basic docs for variables expressions feature
Diffstat (limited to 'doc/ci/yaml')
-rw-r--r--doc/ci/yaml/README.md26
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 7184f3367be..2171da419d1 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -315,9 +315,14 @@ policy configuration.
GitLab now supports both, simple and complex strategies, so it is possible to
use an array and a hash configuration scheme.
-Two keys are now available: `refs` and `kubernetes`. Refs strategy equals to
-simplified only/except configuration, whereas kubernetes strategy accepts only
-`active` keyword.
+Three keys are now available: `refs`, `kubernetes` and `variables`.
+Refs strategy equals to simplified only/except configuration, whereas
+kubernetes strategy accepts only `active` keyword.
+
+`variables` keyword is used to define variables expressions. In other words
+you can use predefined variables / secret variables / project / group or
+environment-scoped variables to define an expression GitLab is going to
+evaluate in order to decide whether a job should be created or not.
See the example below. Job is going to be created only when pipeline has been
scheduled or runs for a `master` branch, and only if kubernetes service is
@@ -332,6 +337,20 @@ job:
kubernetes: active
```
+Example of using variables expressions:
+
+```yaml
+deploy:
+ only:
+ refs:
+ - branches
+ variables:
+ - $RELEASE == "staging"
+ - $STAGING
+```
+
+Learn more about variables expressions on [separate page][variables-expressions].
+
## `tags`
`tags` is used to select specific Runners from the list of all Runners that are
@@ -1549,3 +1568,4 @@ CI with various languages.
[ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
[schedules]: ../../user/project/pipelines/schedules.md
+[variables expressions]: ../variables#variables-expressions