Skip to content
Snippets Groups Projects
Commit 529a54fb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'unsubscribe' into 'master'

Unlink runner from coordinator

gitlab/omnibus-gitlab-runner#1

See merge request !18
parents 3ba62db6 d5e56528
No related branches found
No related tags found
No related merge requests found
v5.2.1
- Add ability to unlink runner from CI coordinator
v5.2.0
- Add RUNNER_DESCRIPTION and RUNNER_TAG_LIST that can be send during runner's registration
 
Loading
Loading
Loading
Loading
@@ -117,6 +117,14 @@ bin/setup -C /my/runner/working/directory
 
You can also specify RUNNER_DESCRIPTION and RUNNER_TAG_LIST during setup.
 
To unlink the runner from the coordinator you can run following command:
```
bin/unlink
```
It will remove the runner's information from the coordinator and remove the given token from the current runner
#### Create an Upstart job (Ubuntu, Centos 6)
 
```
Loading
Loading
v5.2.0
v5.2.1
#!/usr/bin/env ruby
require 'bundler/setup'
require_relative '../lib/unlink'
GitlabCi::Unlink.new
exit
Loading
Loading
@@ -37,6 +37,10 @@ module GitlabCi
end
end
 
def destroy
File.delete(config_path)
end
private
 
def config_path
Loading
Loading
Loading
Loading
@@ -94,6 +94,17 @@ module GitlabCi
end
end
 
def unlink_runner
opts = {
body: default_options.to_json,
headers: {"Content-Type" => "application/json"},
}
response = self.class.delete(api_url + '/runners/delete', opts)
response.code == 200
end
private
 
def broadcast message
Loading
Loading
require_relative 'config'
require_relative 'network'
require 'yaml'
module GitlabCi
class Unlink
def initialize
unlink_runner
end
private
def unlink_runner
status = Network.new.unlink_runner
if status
Config.new.destroy
puts 'Runner unlinked successfully!'
return
else
puts 'Failed to unlink this runner. Perhaps the runner is not subscribed yet or you are having network problems'
end
end
end
end
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