summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2016-02-02 15:39:47 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-19 17:24:59 +0100
commit6ca99bd899322ff4ada84f119907eb0210485482 (patch)
treedc52dc84c7f0ef11ef657f9c7cf326785a0ed800 /lib/ci
parentc850ceec5d595d3808fa566db3d2e88faa3797cf (diff)
downloadgitlab-ce-6ca99bd899322ff4ada84f119907eb0210485482.tar.gz
And CI API endpoint where user can erase a build
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/api/builds.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index 416b0b5f0b4..23e909df366 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -159,6 +159,22 @@ module Ci
build.remove_artifacts_file!
build.remove_artifacts_metadata!
end
+
+ # Erase build (remove artifacts and build trace)
+ #
+ # Parameters:
+ # id (required) - The ID of a build
+ # token (required) - The build authorization token
+ # Headers:
+ # BUILD-TOKEN (required) - The build authorization token, the same as token
+ # Example Request:
+ # PUT /builds/:id/erase
+ put ':id/erase' do
+ build = Ci::Build.find_by_id(params[:id])
+ not_found! unless build
+ authenticate_build_token!(build)
+ build.erase!
+ end
end
end
end