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

unlink runner from coordinator

parent 3ba62db6
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
#!/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