From 21152d7d51815622fd3cbb93836cb8fa7b753ec8 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 3 Feb 2016 11:24:44 +0100 Subject: Use DELETE verb for erasing a build content Also added API specs for that --- lib/ci/api/builds.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.1