Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
8d455503
Commit
8d455503
authored
Dec 28, 2015
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cancel/retry endpoints to build API
parent
e7d0746d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
lib/api/builds.rb
lib/api/builds.rb
+40
-0
No files found.
lib/api/builds.rb
View file @
8d455503
...
@@ -64,6 +64,42 @@ module API
...
@@ -64,6 +64,42 @@ module API
trace
=
build
.
trace
trace
=
build
.
trace
body
trace
body
trace
end
end
# cancel a specific build of a project
#
# parameters:
# id (required) - the id of a project
# build_id (required) - the id of a build
# example request:
# post /projects/:id/build/:build_id/cancel
post
':id/builds/:build_id/cancel'
do
authorize_manage_builds!
build
=
get_build
(
params
[
:build_id
])
return
not_found!
(
build
)
unless
build
build
.
cancel
present
build
,
with:
Entities
::
Build
end
# cancel a specific build of a project
#
# parameters:
# id (required) - the id of a project
# build_id (required) - the id of a build
# example request:
# post /projects/:id/build/:build_id/retry
post
':id/builds/:build_id/retry'
do
authorize_manage_builds!
build
=
get_build
(
params
[
:build_id
])
return
not_found!
(
build
)
unless
build
&&
build
.
retryable?
build
=
Ci
::
Build
.
retry
(
build
)
present
build
,
with:
Entities
::
Build
end
end
end
helpers
do
helpers
do
...
@@ -81,6 +117,10 @@ module API
...
@@ -81,6 +117,10 @@ module API
builds
builds
end
end
end
end
def
authorize_manage_builds!
authorize!
:manage_builds
,
user_project
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment