Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f4d81536
Commit
f4d81536
authored
Mar 29, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy-edit documentation for variables expressions
parent
6ed2370b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
doc/ci/variables/README.md
doc/ci/variables/README.md
+12
-8
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-2
No files found.
doc/ci/variables/README.md
View file @
f4d81536
...
@@ -474,16 +474,16 @@ Each provided variables expression is going to be evaluated before creating
...
@@ -474,16 +474,16 @@ Each provided variables expression is going to be evaluated before creating
a pipeline.
a pipeline.
If any of the conditions in
`variables`
evaluates to truth when using
`only`
,
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
a new job
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.
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
### Supported syntax
Below you can find currently supported syntax reference:
Below you can find currently supported syntax reference:
1.
Equality matching using a string
.
1.
Equality matching using a string
Example: `$VARIABLE == "some value"`
Example: `$VARIABLE == "some value"`
...
@@ -492,18 +492,23 @@ Below you can find currently supported syntax reference:
...
@@ -492,18 +492,23 @@ Below you can find currently supported syntax reference:
value, so both `$VARIABLE == "some value"` and `$VARIABLE == 'some value'`
value, so both `$VARIABLE == "some value"` and `$VARIABLE == 'some value'`
are supported. `"some value" == $VARIABLE` is correct too.
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
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
not. To do that, you can compare variable to `null` value, like
`$VARIABLE == null`. This expression is going to evaluate to truth if
`$VARIABLE == null`. This expression is going to evaluate to truth if
variable is not set.
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`.
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,
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
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:
...
@@ -520,4 +525,3 @@ Below you can find currently supported syntax reference:
[
triggered
]:
../triggers/README.md
[
triggered
]:
../triggers/README.md
[
triggers
]:
../triggers/README.md#pass-job-variables-to-a-trigger
[
triggers
]:
../triggers/README.md#pass-job-variables-to-a-trigger
[
subgroups
]:
../../user/group/subgroups/index.md
[
subgroups
]:
../../user/group/subgroups/index.md
[
build policies
]:
../yaml/#only-and-except-complex
doc/ci/yaml/README.md
View file @
f4d81536
...
@@ -349,7 +349,7 @@ deploy:
...
@@ -349,7 +349,7 @@ deploy:
-
$STAGING
-
$STAGING
```
```
Learn more about variables expressions on
[
separate page
][
variables-expressions
]
.
Learn more about variables expressions on
a separate page
.
## `tags`
## `tags`
...
@@ -1568,4 +1568,3 @@ CI with various languages.
...
@@ -1568,4 +1568,3 @@ CI with various languages.
[
ce-7447
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[
ce-7447
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[
ce-12909
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
[
ce-12909
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
[
schedules
]:
../../user/project/pipelines/schedules.md
[
schedules
]:
../../user/project/pipelines/schedules.md
[
variables expressions
]:
../variables#variables-expressions
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment