Commit e96401f0 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add a download prefix so that we could add file prefix in the future

parent 398de9f1
...@@ -80,11 +80,10 @@ module API ...@@ -80,11 +80,10 @@ module API
# ref_name (required) - The ref from repository # ref_name (required) - The ref from repository
# job (required) - The name for the build # job (required) - The name for the build
# Example Request: # Example Request:
# GET /projects/:id/artifacts/:ref_name/:build_name # GET /projects/:id/artifacts/download/:ref_name?job=name
get ':id/builds/artifacts/:ref_name', get ':id/builds/artifacts/download/:ref_name',
requirements: { ref_name: /.+/ } do requirements: { ref_name: /.+/ } do
builds = user_project.builds_for( builds = user_project.builds_for(params[:job], params[:ref_name])
params[:job], params[:ref_name])
latest_build = builds.success.latest.first latest_build = builds.success.latest.first
......
...@@ -191,7 +191,9 @@ describe API::API, api: true do ...@@ -191,7 +191,9 @@ describe API::API, api: true do
include_context 'artifacts from ref and build name' include_context 'artifacts from ref and build name'
def path_from_ref(ref = pipeline.sha, job = build.name) def path_from_ref(ref = pipeline.sha, job = build.name)
api("/projects/#{project.id}/builds/artifacts/#{ref}?job=#{job}", user) api(
"/projects/#{project.id}/builds/artifacts/download/#{ref}?job=#{job}",
user)
end end
context '401' do context '401' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment