Skip to content
Snippets Groups Projects
Commit 359e2fdb authored by Valery Sizov's avatar Valery Sizov
Browse files

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
No related branches found
No related tags found
No related merge requests found
Pipeline #
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
 
Loading
Loading
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
v5.0.0
v5.2.0
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