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
7de317d4
Commit
7de317d4
authored
Mar 06, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify lib/api/job_artifacts.rb with EE
parent
b8aa65d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
lib/api/job_artifacts.rb
lib/api/job_artifacts.rb
+13
-4
No files found.
lib/api/job_artifacts.rb
View file @
7de317d4
...
...
@@ -2,20 +2,28 @@ module API
class
JobArtifacts
<
Grape
::
API
before
{
authenticate_non_get!
}
# EE::API::JobArtifacts would override the following helpers
helpers
do
def
authorize_download_artifacts!
authorize_read_builds!
end
end
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
API
::
PROJECT_ENDPOINT_REQUIREMENTS
do
desc
'Download the artifacts
fil
e from a job'
do
desc
'Download the artifacts
archiv
e from a job'
do
detail
'This feature was introduced in GitLab 8.10'
end
params
do
requires
:ref_name
,
type:
String
,
desc:
'The ref from repository'
requires
:job
,
type:
String
,
desc:
'The name for the job'
end
route_setting
:authentication
,
job_token_allowed:
true
get
':id/jobs/artifacts/:ref_name/download'
,
requirements:
{
ref_name:
/.+/
}
do
authorize_
read_build
s!
authorize_
download_artifact
s!
builds
=
user_project
.
latest_successful_builds_for
(
params
[
:ref_name
])
latest_build
=
builds
.
find_by!
(
name:
params
[
:job
])
...
...
@@ -23,14 +31,15 @@ module API
present_artifacts!
(
latest_build
.
artifacts_file
)
end
desc
'Download the artifacts
fil
e from a job'
do
desc
'Download the artifacts
archiv
e from a job'
do
detail
'This feature was introduced in GitLab 8.5'
end
params
do
requires
:job_id
,
type:
Integer
,
desc:
'The ID of a job'
end
route_setting
:authentication
,
job_token_allowed:
true
get
':id/jobs/:job_id/artifacts'
do
authorize_
read_build
s!
authorize_
download_artifact
s!
build
=
find_build!
(
params
[
:job_id
])
...
...
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