diff --git a/lib/tasks/copy_site.rake b/lib/tasks/copy_site.rake index 303efbb..d278fbe 100644 --- a/lib/tasks/copy_site.rake +++ b/lib/tasks/copy_site.rake @@ -67,8 +67,8 @@ namespace :create_site do exec_ssh_command_for_create(ssh,"sudo -p 'sudo password:' apt-get install -y sshpass") outputs = exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true) if outputs.join("\n").include?("Host key verification failed") - exec_ssh_command_by_sudo_for_create(session,"ssh-keygen -f \"$HOME/.ssh/known_hosts\" -R #{server.ip}") - exec_ssh_command_by_sudo_for_create(session,"ssh-keyscan -H #{server.ip} >> ~/.ssh/known_hosts") + exec_ssh_command_by_sudo_for_create(ssh,"ssh-keygen -f \"$HOME/.ssh/known_hosts\" -R #{server.ip}") + exec_ssh_command_by_sudo_for_create(ssh,"ssh-keyscan -H #{server.ip} >> ~/.ssh/known_hosts") exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true) end end