Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/gitlab/client/pipelines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,17 @@ def cancel_pipeline(project, id)
def retry_pipeline(project, id)
post("/projects/#{url_encode project}/pipelines/#{id}/retry")
end

# Delete a pipeline
#
# @example
# Gitlab.delete_pipeline(5, 1)
#
# @param [Integer, String] project The ID or name of a project.
# @param [Integer] id The ID of a pipeline.
# @return [void] This API call returns an empty response body.
def delete_pipeline(project, id)
delete("/projects/#{url_encode project}/pipelines/#{id}")
end
end
end
11 changes: 11 additions & 0 deletions spec/gitlab/client/pipelines_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,15 @@
expect(@pipeline_retry.user.name).to eq('Administrator')
end
end

describe '.delete_pipeline' do
before do
stub_delete('/projects/3/pipelines/46', 'empty')
Gitlab.delete_pipeline(3, 46)
end

it 'gets the correct resource' do
expect(a_delete('/projects/3/pipelines/46')).to have_been_made
end
end
end