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
9878f217
Commit
9878f217
authored
Jan 10, 2020
by
Marius Bobin
Committed by
Bob Van Landuyt
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for cross project artifacts
(cherry picked from commit fbb65a15910122689f307fe19dff042ef648a32d)
parent
00c63483
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
changelogs/unreleased/enable-cross-project-artifacts.yml
changelogs/unreleased/enable-cross-project-artifacts.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+45
-0
ee/app/models/ee/ci/build.rb
ee/app/models/ee/ci/build.rb
+1
-1
No files found.
changelogs/unreleased/enable-cross-project-artifacts.yml
0 → 100644
View file @
9878f217
---
title
:
Download cross-project artifacts by using needs keyword in the CI file
merge_request
:
22161
author
:
type
:
added
doc/ci/yaml/README.md
View file @
9878f217
...
@@ -2385,6 +2385,51 @@ rspec:
...
@@ -2385,6 +2385,51 @@ rspec:
-
build_job_3
-
build_job_3
```
```
#### Cross project artifact downloads with `needs` **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/14311) in GitLab v12.7.
`needs`
can be used to download artifacts from up to five jobs in pipelines on
[
other refs in the same project
](
#artifact-downloads-between-pipelines-in-the-same-project
)
,
or pipelines in different projects:
```
yaml
build_job
:
stage
:
build
script
:
-
ls -lhR
needs
:
-
project
:
group/project-name
job
:
build-1
ref
:
master
artifacts
:
true
```
`build_job`
will download the artifacts from the latest successful
`build-1`
job
on the
`master`
branch in the
`group/project-name`
project.
##### Artifact downloads between pipelines in the same project
`needs`
can be used to download artifacts from different pipelines in the current project
by setting the
`project`
keyword as the current project's name, and specifying a ref.
In the example below,
`build_job`
will download the artifacts for the latest successful
`build-1`
job with the
`other-ref`
ref:
```
yaml
build_job
:
stage
:
build
script
:
-
ls -lhR
needs
:
-
project
:
group/same-project-name
job
:
build-1
ref
:
other-ref
artifacts
:
true
```
NOTE:
**Note:**
Downloading artifacts from jobs that are run in
[
`parallel:`
](
#parallel
)
is not supported.
### `coverage`
### `coverage`
> [Introduced][ce-7447] in GitLab 8.17.
> [Introduced][ce-7447] in GitLab 8.17.
...
...
ee/app/models/ee/ci/build.rb
View file @
9878f217
...
@@ -120,7 +120,7 @@ module EE
...
@@ -120,7 +120,7 @@ module EE
override
:cross_dependencies
override
:cross_dependencies
def
cross_dependencies
def
cross_dependencies
return
[]
unless
user_id
return
[]
unless
user_id
return
[]
unless
::
Feature
.
enabled?
(
:cross_project_need_artifacts
,
project
,
default_enabled:
fals
e
)
return
[]
unless
::
Feature
.
enabled?
(
:cross_project_need_artifacts
,
project
,
default_enabled:
tru
e
)
return
[]
unless
project
.
feature_available?
(
:cross_project_pipelines
)
return
[]
unless
project
.
feature_available?
(
:cross_project_pipelines
)
cross_dependencies_relationship
cross_dependencies_relationship
...
...
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