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

Merge branch 'drop-ssh-keygen' into 'master'

Drop ssh keygen
parents 94b120d2 8dba5328
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -73,9 +73,8 @@ module GitlabCi
:failure
end
 
def register_runner(public_key, token)
def register_runner(token)
body = {
public_key: public_key,
token: token
}
 
Loading
Loading
Loading
Loading
@@ -6,7 +6,6 @@ module GitlabCi
class Setup
def initialize
build_config
generate_ssh_key
register_runner
end
 
Loading
Loading
@@ -22,15 +21,9 @@ module GitlabCi
Config.new.write('url', url)
end
 
def generate_ssh_key
system('ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""') # Create a key without a password.
end
def register_runner
registered = false
 
public_key = File.read(File.expand_path('~/.ssh/id_rsa.pub'))
until registered
token = ENV['REGISTRATION_TOKEN']
unless token
Loading
Loading
@@ -38,8 +31,8 @@ module GitlabCi
token = gets.chomp
end
 
puts "Registering runner with public key type: #{public_key[0..6]}, registration token: #{token}, url: #{Config.new.url}."
runner = Network.new.register_runner(public_key, token)
puts "Registering runner with registration token: #{token}, url: #{Config.new.url}."
runner = Network.new.register_runner(token)
 
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