BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
deployments.md
doc/api/deployments.md
+2
-2
builds.rb
lib/api/builds.rb
+6
-8
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