尝试设置 capifony +亚马逊2
我按照说明来设置 capifony。现在我正在执行步骤 4 设置生产服务器。这是我的配置文件:
# deploy.rb
set :application, "MyFirm"
set :deploy_to, "/var/www/myfirm.com"
set :domain, "dev.myfirm.com"
set :scm, :gitrepoit
set :repository, "ssh://[email protected]:/home/myfirm/myfirm.git"
set :user, "ec2-user"
set :domain, "ec2-46-137-123-97.eu-west-1.compute.amazonaws.com"
ssh_options[:keys] = [File.join("foo.key")]
role :web, domain
role :app, domain
role :db, domain, :primary => true
set :use_sudo, false
set :keep_releases, 3
但是当我执行 cap deploy:setup
时,尽管我已经在配置文件中设置了公钥,但它会要求我输入密码...
* executing `deploy:setup'
* executing "mkdir -p /var/www/myfirm.com /var/www/myfirm.com/
releases /var/www/myfirm.com/shared /var/www/myfirm.com/shared/app/
logs /var/www/myfirm.com/shared/web/uploads"
servers: ["ec2-46-137-123-97.eu-west-1.compute.amazonaws.com"]
Password:
知道吗?
卡菲尼2.1.1
I'm following the instructions to setup capifony. Now I'm in the step 4 to setup the production server. This is my configuration file:
# deploy.rb
set :application, "MyFirm"
set :deploy_to, "/var/www/myfirm.com"
set :domain, "dev.myfirm.com"
set :scm, :gitrepoit
set :repository, "ssh://[email protected]:/home/myfirm/myfirm.git"
set :user, "ec2-user"
set :domain, "ec2-46-137-123-97.eu-west-1.compute.amazonaws.com"
ssh_options[:keys] = [File.join("foo.key")]
role :web, domain
role :app, domain
role :db, domain, :primary => true
set :use_sudo, false
set :keep_releases, 3
But when I execute cap deploy:setup
, though I've set the public key in the configuration file, it asks me for a password...
* executing `deploy:setup'
* executing "mkdir -p /var/www/myfirm.com /var/www/myfirm.com/
releases /var/www/myfirm.com/shared /var/www/myfirm.com/shared/app/
logs /var/www/myfirm.com/shared/web/uploads"
servers: ["ec2-46-137-123-97.eu-west-1.compute.amazonaws.com"]
Password:
Any idea?
capifony 2.1.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯..我认为 ssh_options[:keys] 中的路径是相对于配置文件(deploy.rb)的,但实际上是相对于 cap 文件(/var/lib/gems/1.8/bin /帽)。
这是有效的(在 /var/lib/gems/1.8/bin/ 中复制 foo.key 后):
绝对路径当然也有效:
我的最后一个版本:
Well.. I thought the path in
ssh_options[:keys]
is relative to the configuration file (deploy.rb) but actually is relative to the cap file (/var/lib/gems/1.8/bin/cap).This is working (atfer copying foo.key in /var/lib/gems/1.8/bin/):
absolute paths work also of course:
My last release: