summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-29 11:25:49 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-29 11:25:49 +0200
commitf4d81536ac26f75e0aad248ad95c31c9e1f2680b (patch)
treec5a3449ae61bfb01c2f36f5fa765ac8b05ec21d1
parent6ed2370b850ea6db22649ed32940acdc2010877b (diff)
downloadgitlab-ce-feature/gb/variables-expressions-in-only-except.tar.gz
Copy-edit documentation for variables expressionsfeature/gb/variables-expressions-in-only-except
-rw-r--r--doc/ci/variables/README.md20
-rw-r--r--doc/ci/yaml/README.md3
2 files changed, 13 insertions, 10 deletions
diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md
index 25ec12a5b3e..9f268f47e6f 100644
--- a/doc/ci/variables/README.md
+++ b/doc/ci/variables/README.md
@@ -474,16 +474,16 @@ Each provided variables expression is going to be evaluated before creating
a pipeline.
If any of the conditions in `variables` evaluates to truth when using `only`,
-new build is going to be created. If any of the expressions evaluates to truth
-when `except` is being used, a build is not going to be created.
+a new job is going to be created. If any of the expressions evaluates to truth
+when `except` is being used, a job is not going to be created.
-This follows usual rules for [`only` / `except` policies][build policies].
+This follows usual rules for `only` / `except` policies.
### Supported syntax
Below you can find currently supported syntax reference:
-1. Equality matching using a string.
+1. Equality matching using a string
Example: `$VARIABLE == "some value"`
@@ -492,18 +492,23 @@ Below you can find currently supported syntax reference:
value, so both `$VARIABLE == "some value"` and `$VARIABLE == 'some value'`
are supported. `"some value" == $VARIABLE` is correct too.
-1. Checking for an undefined value.
+1. Checking for an undefined value
It sometimes happens that you want to check whether variable is defined or
not. To do that, you can compare variable to `null` value, like
`$VARIABLE == null`. This expression is going to evaluate to truth if
variable is not set.
-1. Comparing two variables.
+1. Checking for an empty variable
+
+ If you want to check whether a variable is defined, but is empty, you can
+ simply compare it against an empty string, like `$VAR == ''`.
+
+1. Comparing two variables
It is possible to compare two variables. `$VARIABLE_1 == $VARIABLE_2`.
-1. Variable presence check.
+1. Variable presence check
If you only want to create a job when there is some variable present,
which means that it is defined and non-empty, you can simply use
@@ -520,4 +525,3 @@ Below you can find currently supported syntax reference:
[triggered]: ../triggers/README.md
[triggers]: ../triggers/README.md#pass-job-variables-to-a-trigger
[subgroups]: ../../user/group/subgroups/index.md
-[build policies]: ../yaml/#only-and-except-complex
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 2171da419d1..3382fbc2d12 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -349,7 +349,7 @@ deploy:
- $STAGING
```
-Learn more about variables expressions on [separate page][variables-expressions].
+Learn more about variables expressions on a separate page.
## `tags`
@@ -1568,4 +1568,3 @@ 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