summaryrefslogtreecommitdiff
path: root/doc/ci/variables
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-06-06 08:34:57 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-06-06 08:34:57 +0000
commit502cbda11ba0c6d798b243ab6f489cd73c7bdeea (patch)
tree317a055ca33c2284212987a305bab143583463da /doc/ci/variables
parent8501edcd465923c9c6a45abe6c863fc3cd25973a (diff)
parentcfaac7532210ef1ce03f335a3198bb7d2ad3979a (diff)
downloadgitlab-ce-502cbda11ba0c6d798b243ab6f489cd73c7bdeea.tar.gz
Merge branch 'ci-variable-expression-con-dis-junction' into 'master'
CI variable expression conjunction/disjunction See merge request gitlab-org/gitlab-ce!27925
Diffstat (limited to 'doc/ci/variables')
-rw-r--r--doc/ci/variables/README.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md
index c851931e85c..fe64f5ab2e0 100644
--- a/doc/ci/variables/README.md
+++ b/doc/ci/variables/README.md
@@ -479,6 +479,7 @@ Below you can find supported syntax reference:
1. Equality matching using a string
> Example: `$VARIABLE == "some value"`
+
> Example: `$VARIABLE != "some value"` _(added in 11.11)_
You can use equality operator `==` or `!=` to compare a variable content to a
@@ -489,6 +490,7 @@ Below you can find supported syntax reference:
1. Checking for an undefined value
> Example: `$VARIABLE == null`
+
> Example: `$VARIABLE != null` _(added in 11.11)_
It sometimes happens that you want to check whether a variable is defined
@@ -499,6 +501,7 @@ Below you can find supported syntax reference:
1. Checking for an empty variable
> Example: `$VARIABLE == ""`
+
> Example: `$VARIABLE != ""` _(added in 11.11)_
If you want to check whether a variable is defined, but is empty, you can
@@ -508,6 +511,7 @@ Below you can find supported syntax reference:
1. Comparing two variables
> Example: `$VARIABLE_1 == $VARIABLE_2`
+
> Example: `$VARIABLE_1 != $VARIABLE_2` _(added in 11.11)_
It is possible to compare two variables. This is going to compare values
@@ -527,6 +531,7 @@ Below you can find supported syntax reference:
1. Pattern matching _(added in 11.0)_
> Example: `$VARIABLE =~ /^content.*/`
+
> Example: `$VARIABLE_1 !~ /^content.*/` _(added in 11.11)_
It is possible perform pattern matching against a variable and regular
@@ -536,6 +541,19 @@ Below you can find supported syntax reference:
Pattern matching is case-sensitive by default. Use `i` flag modifier, like
`/pattern/i` to make a pattern case-insensitive.
+1. Conjunction / Disjunction
+
+ > Example: `$VARIABLE1 =~ /^content.*/ && $VARIABLE2 == "something"`
+
+ > Example: `$VARIABLE1 =~ /^content.*/ && $VARIABLE2 =~ /thing$/ && $VARIABLE3`
+
+ > Example: `$VARIABLE1 =~ /^content.*/ || $VARIABLE2 =~ /thing$/ && $VARIABLE3`
+
+ It is possible to join multiple conditions using `&&` or `||`. Any of the otherwise
+ supported syntax may be used in a conjunctive or disjunctive statement.
+ Precedence of operators follows standard Ruby 2.5 operation
+ [precedence](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html).
+
## Debug tracing
> Introduced in GitLab Runner 1.7.