summaryrefslogtreecommitdiff
path: root/lib/ci/api/builds.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-11-09 22:01:26 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-11-10 12:51:51 +0100
commitdb3213fc1c653b20783f9a41074eaf17132010de (patch)
tree80668282d2ff9fd314d47bda96d3f53a4d31301d /lib/ci/api/builds.rb
parent7e4e3fb3b6177d2863580786e9ef6ee3a4ccf037 (diff)
downloadgitlab-ce-db3213fc1c653b20783f9a41074eaf17132010de.tar.gz
Use normal file upload mechanism to upload artifacts
Diffstat (limited to 'lib/ci/api/builds.rb')
-rw-r--r--lib/ci/api/builds.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index 622849c4b11..dab0df12635 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -53,7 +53,7 @@ module Ci
# Parameters:
# id (required) - The ID of a build
# token (required) - The build authorization token
- # size (optional) - the size of uploaded file
+ # filesize (optional) - the size of uploaded file
# Example Request:
# POST /builds/:id/artifacts/authorize
post ":id/artifacts/authorize" do
@@ -77,18 +77,16 @@ module Ci
# Parameters:
# id (required) - The ID of a build
# token (required) - The build authorization token
+ # file (required) - The uploaded file
+ # Parameters (accelerated by GitLab Workhorse):
+ # file.path - path to locally stored body (generated by Workhorse)
+ # file.name - real filename as send in Content-Disposition
+ # file.type - real content type as send in Content-Type
# Headers:
- # Content-Type - File content type
- # Content-Disposition - File media type and real name
# BUILD-TOKEN (required) - The build authorization token, the same as token
# Body:
# The file content
#
- # Parameters (set by GitLab Workhorse):
- # file - path to locally stored body (generated by Workhorse)
- # filename - real filename as send in Content-Disposition
- # filetype - real content type as send in Content-Type
- # filesize - real file size as send in Content-Length
# Example Request:
# POST /builds/:id/artifacts
post ":id/artifacts" do
@@ -98,7 +96,7 @@ module Ci
authenticate_build_token!(build)
forbidden!('build is not running') unless build.running?
- file = uploaded_file!(ArtifactUploader.artifacts_upload_path)
+ file = uploaded_file!(:file, ArtifactUploader.artifacts_upload_path)
file_to_large! unless file.size < max_artifacts_size
if build.update_attributes(artifacts_file: file)