Capistrano ssh_options aws部署问题

时间:2013-09-26 01:38:43

标签: ruby-on-rails amazon-web-services capistrano

所以我试图通过capistrano部署一个应用程序,但尽管尝试了多种格式来引用pem文件,但它反复询问我的密码。 pem文件位于rails项目的根目录中,名为highlandsapptestdeploy。这是我的代码:另外,我不确定我的服务器引用是否正确?

set :application, "highlandsfacebookart"
set :repository,  "https://onenoc@bitbucket.org/onenoc/highlands-coffee-art-app.git"

set :user, 'deploy'
set :use_sudo, false
set :deploy_to, "/var/www/#{application}#"
set :deploy_via, :remote_cache
ssh_options[:keys] = %w(/highlandsapptestdeploy/highlandsfbkey.pem)


# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

role :web, "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"                          # Your HTTP server, Apache/etc
role :app, "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"                          # This may be the same as your `Web` server
role :db,  "ec2-54-200-24-60.us-west-2.compute.amazonaws.com", :primary => true # This is where Rails migrations will run
role :db,  "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"

2 个答案:

答案 0 :(得分:3)

我感觉您的用户名不正确。你确定它是“部署”吗?

答案 1 :(得分:1)

您还需要ssh-agent在您的计算机上工作。代理正常工作后,您应该能够ssh进入计算机而无需提供密码或密码。然后,您需要告诉Capistrano从代理转发身份验证。

ssh_options[:forward_agent] => true