And CI API endpoint where user can erase a build
This commit is contained in:
parent
c850ceec5d
commit
6ca99bd899
3 changed files with 21 additions and 2 deletions
|
@ -83,7 +83,8 @@
|
|||
= raw @build.trace_html
|
||||
- else
|
||||
.erased.alert.alert-warning
|
||||
Build has been erased by #{@build.erased_by.username} #{time_ago_with_tooltip(@build.created_at)}
|
||||
- erased_by = "by #{@build.erased_by.username}" if @build.erased_by
|
||||
Build has been erased #{erased_by} #{time_ago_with_tooltip(@build.created_at)}
|
||||
|
||||
%div#down-build-trace
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
step 'recent build summary contains information saying that build has been erased' do
|
||||
expect(page).to have_css('.erased')
|
||||
page.within('.erased') do
|
||||
expect(page).to have_content 'Build has been erased'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue