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
Kazuhiko Shiozaki
gitlab-ce
Commits
d8eeeb69
Commit
d8eeeb69
authored
Mar 13, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor dependencies directive
[ci skip]
parent
de7c3316
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+26
-21
No files found.
doc/ci/yaml/README.md
View file @
d8eeeb69
...
@@ -236,14 +236,14 @@ job_name:
...
@@ -236,14 +236,14 @@ job_name:
| Keyword | Required | Description |
| Keyword | Required | Description |
|---------------|----------|-------------|
|---------------|----------|-------------|
| script | yes | Defines a shell script which is executed by runner |
| script | yes | Defines a shell script which is executed by runner |
| stage | no
(default:
`test`
) | Defines a build stage
|
| stage | no
| Defines a build stage (default:
`test`
)
|
| type | no | Alias for
`stage`
|
| type | no | Alias for
`stage`
|
| only | no | Defines a list of git refs for which build is created |
| only | no | Defines a list of git refs for which build is created |
| except | no | Defines a list of git refs for which build is not created |
| except | no | Defines a list of git refs for which build is not created |
| tags | no | Defines a list of tags which are used to select runner |
| tags | no | Defines a list of tags which are used to select runner |
| allow_failure | no | Allow build to fail. Failed build doesn't contribute to commit status |
| allow_failure | no | Allow build to fail. Failed build doesn't contribute to commit status |
| when | no | Define when to run build. Can be
`on_success`
,
`on_failure`
or
`always`
|
| when | no | Define when to run build. Can be
`on_success`
,
`on_failure`
or
`always`
|
| dependencies | no | Define
a builds that this build depends on
|
| dependencies | no | Define
other builds that a build depends on so that you can pass artifacts between them
|
| artifacts | no | Define list build artifacts |
| artifacts | no | Define list build artifacts |
| cache | no | Define list of files that should be cached between subsequent runs |
| cache | no | Define list of files that should be cached between subsequent runs |
...
@@ -404,7 +404,10 @@ The above script will:
...
@@ -404,7 +404,10 @@ The above script will:
> - Build artifacts are only collected for successful builds.
> - Build artifacts are only collected for successful builds.
`artifacts`
is used to specify list of files and directories which should be
`artifacts`
is used to specify list of files and directories which should be
attached to build after success. Below are some examples.
attached to build after success. To pass artifacts between different builds,
see
[
dependencies
](
#dependencies
)
.
Below are some examples.
Send all files in
`binaries`
and
`.config`
:
Send all files in
`binaries`
and
`.config`
:
...
@@ -524,56 +527,58 @@ job:
...
@@ -524,56 +527,58 @@ job:
>**Note:**
>**Note:**
Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
This feature should be used with
`artifacts`
and allows to define artifacts passing between different builds.
This feature should be used in conjunction with
[
`artifacts`
](
#artifacts
)
and
allows you to define the artifacts to pass between different builds.
`artifacts`
from previous stages
are passed by default.
Note that
`artifacts`
from previous
[
stages
](
#stages
)
are passed by default.
To use
a feature define
`dependencies`
in context of the build
and pass
To use
this feature, define
`dependencies`
in context of the job
and pass
a list of all previous builds from which the artifacts should be downloaded.
a list of all previous builds from which the artifacts should be downloaded.
You can only define a builds from stages that are executed before this one.
You can only define builds from stages that are executed before the current one.
Error will be shown if you define builds from current stage or next stages.
An error will be shown if you define builds from the current stage or next ones.
---
How to use artifacts passing between stages:
In the following example, we define two jobs with artifacts,
`build:osx`
and
`build:linux`
. When the
`test:osx`
is executed, the artifacts from
`build:osx`
will be downloaded and extracted in the context of the build. The same happens
for
`test:linux`
and artifacts from
`build:linux`
.
The job
`deploy`
will download artifacts from all previous builds because of
the
[
stage
](
#stages
)
precedence:
```
```
build:osx:
build:osx:
stage: build
stage: build
script:
...
script:
make build:osx
artifacts:
artifacts:
paths:
paths:
- binaries/
- binaries/
build:linux:
build:linux:
stage: build
stage: build
script:
...
script:
make build:linux
artifacts:
artifacts:
paths:
paths:
- binaries/
- binaries/
test:osx:
test:osx:
stage: test
stage: test
script:
...
script:
make test:osx
dependencies:
dependencies:
- build:osx
- build:osx
test:linux:
test:linux:
stage: test
stage: test
script:
...
script:
make test:linux
dependencies:
dependencies:
- build:linux
- build:linux
deploy:
deploy:
stage: deploy
stage: deploy
script:
...
script:
make deploy
```
```
The above will create a build artifacts for two jobs:
`build:osx`
and
`build:linux`
.
When executing the
`test:osx`
the artifacts for
`build:osx`
will be downloaded and extracted in context of the build.
The same happens for
`test:linux`
and artifacts from
`build:linux`
.
The job
`deploy`
will download artifacts from all previous builds.
However, only the
`build:osx`
and
`build:linux`
exports artifacts so only these will be downloaded.
### cache
### cache
>**Note:**
>**Note:**
...
...
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