summaryrefslogtreecommitdiff
path: root/lib/ci/api
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-01-14 21:58:17 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2016-01-14 21:58:17 +0100
commit768721dc5895467130b9a3ada9c740a050f4fdff (patch)
treed96448edb9490825e8384a1b42bbfafa98140a33 /lib/ci/api
parent7ed5bc5c9b69e6caf45541dc8f820aa59a20c160 (diff)
parent2f2aada3b6b900fdff276aafc3f93e5a1c1465c6 (diff)
downloadgitlab-ce-768721dc5895467130b9a3ada9c740a050f4fdff.tar.gz
Merge branch 'master' into ci/api-triggers
* master: (150 commits) fixes margin and padding Update mailroom/postfix documentation [ci skip] Fix css mess around git clone panel. Align it properly Fix missing padding for user/group pages Fix parse_gollum_tags matcher Update documentation on Banzai::Filter::GollumTagsFilter Add tests for the wiki pipeline Refactoring Banzai::Filter::GollumTagsFilter Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter Remove GollumTagsPipeline Refactoring Gitlab::GithubImport::Importer Remove unnecessary brackets on WIKI_SLUG_ID route constraints Move js function to removing accents to vendor/assets/javascripts Update CHANGELOG Use the WikiPipeline when rendering the wiki markdown content Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML Relax constraints for wiki slug Import GitHub wiki into GitLab Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus Revert changes to how the notes are paginated in the API ... Conflicts: doc/api/README.md lib/api/entities.rb
Diffstat (limited to 'lib/ci/api')
-rw-r--r--lib/ci/api/builds.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index 15faa6edd84..fb87637b94f 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -78,11 +78,13 @@ module Ci
# Parameters:
# id (required) - The ID of a build
# token (required) - The build authorization token
- # file (required) - The uploaded file
+ # file (required) - Artifacts 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
+ # metadata.path - path to locally stored body (generated by Workhorse)
+ # metadata.name - filename (generated by Workhorse)
# Headers:
# BUILD-TOKEN (required) - The build authorization token, the same as token
# Body:
@@ -96,13 +98,20 @@ module Ci
build = Ci::Build.find_by_id(params[:id])
not_found! unless build
authenticate_build_token!(build)
- forbidden!('build is not running') unless build.running?
+ forbidden!('Build is not running!') unless build.running?
- file = uploaded_file!(:file, ArtifactUploader.artifacts_upload_path)
- file_to_large! unless file.size < max_artifacts_size
+ artifacts_upload_path = ArtifactUploader.artifacts_upload_path
+ artifacts = uploaded_file(:file, artifacts_upload_path)
+ metadata = uploaded_file(:metadata, artifacts_upload_path)
- if build.update_attributes(artifacts_file: file)
- present build, with: Entities::Build
+ bad_request!('Missing artifacts file!') unless artifacts
+ file_to_large! unless artifacts.size < max_artifacts_size
+
+ build.artifacts_file = artifacts
+ build.artifacts_metadata = metadata
+
+ if build.save
+ present(build, with: Entities::Build)
else
render_validation_error!(build)
end
@@ -148,6 +157,7 @@ module Ci
not_found! unless build
authenticate_build_token!(build)
build.remove_artifacts_file!
+ build.remove_artifacts_metadata!
end
end
end