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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9edab080
Commit
9edab080
authored
Apr 09, 2021
by
Furkan Ayhan
Committed by
Marcel Amirault
Apr 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation for workflow:rules:variables
parent
6798107e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+33
-0
No files found.
doc/ci/yaml/README.md
View file @
9edab080
...
...
@@ -250,8 +250,41 @@ workflow:
-
if
:
$CI_COMMIT_REF_NAME =~ /feature/
variables
:
IS_A_FEATURE
:
"
true"
# Define a new variable.
-
when
:
always
# Run the pipeline in other cases
job1
:
variables
:
DEPLOY_VARIABLE
:
"
job1-default-deploy"
rules
:
-
if
:
$CI_COMMIT_REF_NAME =~ /master/
variables
:
# Override DEPLOY_VARIABLE defined
DEPLOY_VARIABLE
:
"
job1-deploy-production"
# at the job level.
-
when
:
on_success
# Run the job in other cases
script
:
-
echo "Run script with $DEPLOY_VARIABLE as an argument"
-
echo "Run another script if $IS_A_FEATURE exists"
job2
:
script
:
-
echo "Run script with $DEPLOY_VARIABLE as an argument"
-
echo "Run another script if $IS_A_FEATURE exists"
```
When the branch is
`master`
:
-
job1's
`DEPLOY_VARIABLE`
is
`job1-deploy-production`
.
-
job2's
`DEPLOY_VARIABLE`
is
`deploy-production`
.
When the branch is
`feature`
:
-
job1's
`DEPLOY_VARIABLE`
is
`job1-default-deploy`
, and
`IS_A_FEATURE`
is
`true`
.
-
job2's
`DEPLOY_VARIABLE`
is
`default-deploy`
, and
`IS_A_FEATURE`
is
`true`
.
When the branch is something else:
-
job1's
`DEPLOY_VARIABLE`
is
`job1-default-deploy`
.
-
job2's
`DEPLOY_VARIABLE`
is
`default-deploy`
.
##### Enable or disable workflow:rules:variables **(CORE ONLY)**
rules:variables is under development and not ready for production use.
...
...
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