Skip to content
Snippets Groups Projects
Commit 609f8ed9 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Send tag_list to CI during registration

parent 053e721b
No related branches found
No related tags found
1 merge request!12Send description and tag_list during registration
Loading
Loading
@@ -107,6 +107,8 @@ You can tell `bin/setup` to use a different directory with the `-C` switch.
bin/setup -C /my/runner/working/directory
```
 
You can also specify RUNNER_DESCRIPTION and RUNNER_TAG_LIST during setup.
#### Create an Upstart job (Ubuntu, Centos 6)
 
```
Loading
Loading
Loading
Loading
@@ -17,12 +17,6 @@ module GitlabCi
end
end
 
def hostname
@config.fetch('hostname') do
Socket.gethostname
end
end
def token
@config['token']
end
Loading
Loading
Loading
Loading
@@ -73,10 +73,11 @@ module GitlabCi
:failure
end
 
def register_runner(token)
def register_runner(token, description, tag_list)
body = {
token: token,
hostname: config.hostname
tag_list: tag_list,
description: description
}
 
opts = {
Loading
Loading
Loading
Loading
@@ -26,13 +26,16 @@ module GitlabCi
 
until registered
token = ENV['REGISTRATION_TOKEN']
description = ENV['RUNNER_DESCRIPTION'] || Socket.gethostname
tag_list = ENV['RUNNER_TAG_LIST']
unless token
puts 'Please enter the gitlab-ci token for this runner: '
token = gets.chomp
end
 
puts "Registering runner with registration token: #{token}, url: #{Config.new.url}."
runner = Network.new.register_runner(token)
puts "Registering runner as #{description} with registration token: #{token}, url: #{Config.new.url}."
runner = Network.new.register_runner(token, description, tag_list)
 
if runner
write_token(runner[:token])
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment