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
# ref_name (required) - The ref from repository
# job (required) - The name for the build
# Example Request:
# GET /projects/:id/artifacts/:ref_name/:build_name
get ':id/builds/artifacts/:ref_name',
# GET /projects/:id/artifacts/download/:ref_name?job=name
get ':id/builds/artifacts/download/:ref_name',
requirements: { ref_name: /.+/ } do
builds = user_project.builds_for(
params[:job], params[:ref_name])
builds = user_project.builds_for(params[:job], params[:ref_name])
latest_build = builds.success.latest.first
......
......@@ -191,7 +191,9 @@ describe API::API, api: true do
include_context 'artifacts from ref and 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
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