Module: Pointer::BitBucket

Included in:
EasyDeploy
Defined in:
lib/pointer/bit_bucket.rb

Instance Method Summary collapse

Instance Method Details

#add_bit_bucket_hostObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pointer/bit_bucket.rb', line 3

def add_bit_bucket_host()
  what "Use this as deploy key"
  puts '----'
  puts get_file_contents('/home/rails/.ssh/id_rsa.pub')
  puts '----'

  if bitbucket
    if @ssh.exec!('bash -lc "ssh -o StrictHostKeyChecking=no [email protected]"') =~ /Permission denied/
      puts "Press ENTER when you added this deploy key to repository".red
      STDIN.readline()
    end
  else
    puts "You need to ssh into your machine as 'ssh #{rails_user}@#{host} -p #{port}'"
    puts "then connect via ssh to your repository hosting, like so 'ssh [email protected]' and accept the key"
    puts "Then you need to install the deploy key above"
    puts "Press ENTER when you added this deploy key to repository".red
    STDIN.readline()
  end
end