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
596bbf67
Unverified
Commit
596bbf67
authored
Nov 15, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send registry_url with build data to GitLab Runner
parent
0934f8d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
entities.rb
lib/ci/api/entities.rb
+4
-0
builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+29
-0
No files found.
lib/ci/api/entities.rb
View file @
596bbf67
...
...
@@ -50,6 +50,10 @@ module Ci
expose
:variables
expose
:depends_on_builds
,
using:
Build
expose
:registry_url
,
if:
->
(
_
,
_
)
{
Gitlab
.
config
.
registry
.
enabled
}
do
|
_
|
Gitlab
.
config
.
registry
.
host_port
end
end
class
Runner
<
Grape
::
Entity
...
...
spec/requests/ci/api/builds_spec.rb
View file @
596bbf67
...
...
@@ -17,6 +17,10 @@ describe Ci::API::API do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'spinach'
,
stage:
'test'
,
stage_idx:
0
)
}
let
(
:user_agent
)
{
'gitlab-ci-multi-runner 1.5.2 (1-5-stable; go1.6.3; linux/amd64)'
}
before
do
stub_container_registry_config
(
enabled:
false
)
end
shared_examples
'no builds available'
do
context
'when runner sends version in User-Agent'
do
context
'for stable version'
do
...
...
@@ -53,6 +57,31 @@ describe Ci::API::API do
it
'updates runner info'
do
expect
{
register_builds
}.
to
change
{
runner
.
reload
.
contacted_at
}
end
context
'when registry is enabled'
do
before
do
stub_container_registry_config
(
enabled:
true
,
host_port:
'registry.example.com:5005'
)
end
it
'sends registry_url key'
do
register_builds
info:
{
platform: :darwin
}
expect
(
json_response
).
to
have_key
(
'registry_url'
)
expect
(
json_response
[
'registry_url'
]).
to
eq
(
"registry.example.com:5005"
)
end
end
context
'when registry is disabled'
do
before
do
stub_container_registry_config
(
enabled:
false
,
host_port:
'registry.example.com:5005'
)
end
it
'does not send registry_url key'
do
register_builds
info:
{
platform: :darwin
}
expect
(
json_response
).
not_to
have_key
(
'registry_url'
)
end
end
end
context
'when builds are finished'
do
...
...
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