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
596bbf67
Commit
596bbf67
authored
8 years ago
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send registry_url with build data to GitLab Runner
parent
0934f8d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
lib/ci/api/entities.rb
lib/ci/api/entities.rb
+4
-0
spec/requests/ci/api/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
...
@@ -50,6 +50,10 @@ module Ci
expose
:variables
expose
:variables
expose
:depends_on_builds
,
using:
Build
expose
:depends_on_builds
,
using:
Build
expose
:registry_url
,
if:
->
(
_
,
_
)
{
Gitlab
.
config
.
registry
.
enabled
}
do
|
_
|
Gitlab
.
config
.
registry
.
host_port
end
end
end
class
Runner
<
Grape
::
Entity
class
Runner
<
Grape
::
Entity
...
...
This diff is collapsed.
Click to expand it.
spec/requests/ci/api/builds_spec.rb
View file @
596bbf67
...
@@ -17,6 +17,10 @@ describe Ci::API::API do
...
@@ -17,6 +17,10 @@ describe Ci::API::API do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'spinach'
,
stage:
'test'
,
stage_idx:
0
)
}
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)'
}
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
shared_examples
'no builds available'
do
context
'when runner sends version in User-Agent'
do
context
'when runner sends version in User-Agent'
do
context
'for stable version'
do
context
'for stable version'
do
...
@@ -53,6 +57,31 @@ describe Ci::API::API do
...
@@ -53,6 +57,31 @@ describe Ci::API::API do
it
'updates runner info'
do
it
'updates runner info'
do
expect
{
register_builds
}.
to
change
{
runner
.
reload
.
contacted_at
}
expect
{
register_builds
}.
to
change
{
runner
.
reload
.
contacted_at
}
end
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
end
context
'when builds are finished'
do
context
'when builds are finished'
do
...
...
This diff is collapsed.
Click to expand it.
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