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
Léo-Paul Géneau
gitlab-ce
Commits
ba01e519
Commit
ba01e519
authored
Aug 18, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incorporate feedback
parent
182e2814
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
doc/api/deployments.md
doc/api/deployments.md
+2
-2
lib/api/builds.rb
lib/api/builds.rb
+6
-8
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+1
-0
No files found.
doc/api/deployments.md
View file @
ba01e519
...
...
@@ -260,10 +260,10 @@ GET /projects/:id/deployments/:deployment_id
| Attribute | Type | Required | Description |
|-----------|---------|----------|---------------------|
|
`id`
| integer | yes | The ID of a project |
|
`deployment_id`
|
string
| yes | The ID of the deployment |
|
`deployment_id`
|
integer
| yes | The ID of the deployment |
```
bash
curl
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/projects/1/deployment/1"
curl
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/projects/1/deployment
s
/1"
```
Example of response
...
...
lib/api/builds.rb
View file @
ba01e519
...
...
@@ -202,15 +202,13 @@ module API
build
=
get_build!
(
params
[
:build_id
])
if
build
.
playable?
build
.
play
(
current_user
)
bad_request!
(
"Unplayable Build"
)
unless
build
.
playable?
status
200
present
build
,
with:
Entities
::
Build
,
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
else
bad_request!
(
"Unplayable Build"
)
end
build
.
play
(
current_user
)
status
200
present
build
,
with:
Entities
::
Build
,
user_can_download_artifacts:
can?
(
current_user
,
:read_build
,
user_project
)
end
end
...
...
spec/requests/api/builds_spec.rb
View file @
ba01e519
...
...
@@ -419,6 +419,7 @@ describe API::API, api: true do
it
'plays the build'
do
expect
(
response
).
to
have_http_status
200
expect
(
json_response
[
'user'
][
'id'
]).
to
eq
(
user
.
id
)
expect
(
json_response
[
'id'
]).
to
eq
(
build
.
id
)
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