mirror of
https://github.com/dokku/dokku.git
synced 2026-08-29 10:08:53 +02:00
Copy the id_rsa.pub key to the vm where possible
This allows dokku-installer to automatically list the public key in it's UI
This commit is contained in:
6
Vagrantfile
vendored
6
Vagrantfile
vendored
@@ -7,6 +7,7 @@ BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
|
||||
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
|
||||
DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2"
|
||||
PREBUILT_STACK_URL = File.exist?("#{File.dirname(__FILE__)}/stack.tgz") ? 'file:///root/dokku/stack.tgz' : nil
|
||||
PUBLIC_KEY_PATH = "#{Dir.home}/.ssh/id_rsa.pub"
|
||||
|
||||
make_cmd = "make install"
|
||||
if PREBUILT_STACK_URL
|
||||
@@ -48,4 +49,9 @@ Vagrant::configure("2") do |config|
|
||||
config.vm.define "build", autostart: false do |vm|
|
||||
vm.vm.provision :shell, :inline => "cd /root/dokku && make deb-all"
|
||||
end
|
||||
|
||||
if Pathname.new(PUBLIC_KEY_PATH).exist?
|
||||
config.vm.provision :file, source: PUBLIC_KEY_PATH, destination: '/tmp/id_rsa.pub'
|
||||
config.vm.provision :shell, :inline => "rm /root/.ssh/authorized_keys && mv /tmp/id_rsa.pub /root/.ssh/authorized_keys"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user