Commit 359e2fdb authored by Valery Sizov's avatar Valery Sizov

Merge branch 'changelog' into 'master'

Send description and tag_list during registration

If specified RUNNER_DESCRIPTION or RUNNER_TAG_LIST can be send during registration. By default hostname is used for description.

See merge request !12
parents 053e721b b7963a5f
Pipeline #1110 passed with stage
v5.2.0
- Add RUNNER_DESCRIPTION and RUNNER_TAG_LIST that can be send during runner's registration
v5.1.0
- Add `-C` command-line option to specify the working directory
......
......@@ -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)
```
......
......@@ -17,12 +17,6 @@ module GitlabCi
end
end
def hostname
@config.fetch('hostname') do
Socket.gethostname
end
end
def token
@config['token']
end
......
......@@ -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 = {
......
......@@ -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])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment