summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2016-02-03 11:24:44 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-19 17:24:59 +0100
commit21152d7d51815622fd3cbb93836cb8fa7b753ec8 (patch)
treecdc920f90683104132c924259dd8b060887338f8 /lib/ci
parent6ca99bd899322ff4ada84f119907eb0210485482 (diff)
downloadgitlab-ce-21152d7d51815622fd3cbb93836cb8fa7b753ec8.tar.gz
Use DELETE verb for erasing a build content
Also added API specs for that
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/api/builds.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index 23e909df366..2d3d6c75f00 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -156,6 +156,7 @@ module Ci
build = Ci::Build.find_by_id(params[:id])
not_found! unless build
authenticate_build_token!(build)
+
build.remove_artifacts_file!
build.remove_artifacts_metadata!
end
@@ -168,11 +169,12 @@ module Ci
# Headers:
# BUILD-TOKEN (required) - The build authorization token, the same as token
# Example Request:
- # PUT /builds/:id/erase
- put ':id/erase' do
+ # DELETE /builds/:id/content
+ delete ':id/content' do
build = Ci::Build.find_by_id(params[:id])
not_found! unless build
authenticate_build_token!(build)
+
build.erase!
end
end