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
Boxiang Sun
gitlab-ce
Commits
a52960f5
Commit
a52960f5
authored
Oct 02, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic documentation for only: changes feature
parent
0dd892aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+36
-1
No files found.
doc/ci/yaml/README.md
View file @
a52960f5
...
...
@@ -387,6 +387,8 @@ except master.
> `refs` and `kubernetes` policies introduced in GitLab 10.0
>
> `variables` policy introduced in 10.7
>
> `changes` policy introduced in 11.4
CAUTION:
**Warning:**
This an _alpha_ feature, and it it subject to change at any time without
...
...
@@ -398,10 +400,15 @@ policy configuration.
GitLab now supports both, simple and complex strategies, so it is possible to
use an array and a hash configuration scheme.
Three keys are now available:
`refs`
,
`kubernetes`
and
`variables`
.
Four keys are now available:
`refs`
,
`kubernetes`
and
`variables`
and
`changes`
.
### `refs` and `kubernetes`
Refs strategy equals to simplified only/except configuration, whereas
kubernetes strategy accepts only
`active`
keyword.
### `variables`
`variables`
keyword is used to define variables expressions. In other words
you can use predefined variables / project / group or
environment-scoped variables to define an expression GitLab is going to
...
...
@@ -445,6 +452,34 @@ end-to-end:
Learn more about variables expressions on
[
a separate page
][
variables-expressions
]
.
### `changes`
Using
`changes`
keyword with
`only`
or
`except`
makes it possible to define if
a job should be created, based on files modified by a git push event.
```
yaml
docker build
:
script
:
docker build -t my-image:$CI_COMMIT_REF_SLUG .
only
:
changes
:
-
Dockerfile
-
docker/scripts/*
```
In the scenario above, if you are pushing multiple commits to GitLab, to an
exising branch, GitLab is going to create and trigger
`docker build`
if one of
the commits contains changes to the
`Dockerfile`
file or any of the files
inside
`docker/scripts/`
directory.
CAUTION:
**Warning:**
If you are pushing a
**new**
branch or a tag to GitLab, only/changes is going
to always evaluate to truth and GitLab will create a job. This feature is not
connected with merge requests yet, GitLab is creating pipelines before an user
creates a merge requests and specifies a target branch. Without a target branch
it is not possible to know what the common ancestor is in case of pushing a new
branch, thus we always create a job in that case. This feature works best for
stable branches like
`master`
.
## `tags`
`tags`
is used to select specific Runners from the list of all Runners that are
...
...
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