尝试设置 capifony +亚马逊2

发布于 2024-12-06 02:52:42 字数 1204 浏览 0 评论 0原文

我按照说明来设置 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

舞袖。长 2024-12-13 02:52:42

嗯..我认为 ssh_options[:keys] 中的路径是相对于配置文件(deploy.rb)的,但实际上是相对于 cap 文件(/var/lib/gems/1.8/bin /帽)。

这是有效的(在 /var/lib/gems/1.8/bin/ 中复制 foo.key 后):

ssh_options[:keys] = ["foo.pem")]

绝对路径当然也有效:

ssh_options[:keys] = ["/home/me/foo.pem")]

ssh_options[:keys] = [File.join(ENV["HOME"], "foo.pem")]

我的最后一个版本:

# deploy.rb

set   :application,   "MyFirm"
set   :deploy_to,     "/var/www/myfirm.com"
set   :domain,        "dev.myfirm.com"

default_run_options[:pty] = true

set   :scm,           :git
set   :repository,    "[email protected]:/home/myfirm/myfirm.git"

set :ssh_options, {:forward_agent => true}

set :user, "ec2-user"
set :domain, "ec2-41-137-132-97.eu-west-1.compute.amazonaws.com"
ssh_options[:keys] = ["foo.pem"]


role  :web,           domain
role  :app,           domain
role  :db,            domain, :primary => true

set   :use_sudo,      false
set   :keep_releases, 3

set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads", "vendor"]
set :update_vendors, true

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/):

ssh_options[:keys] = ["foo.pem")]

absolute paths work also of course:

ssh_options[:keys] = ["/home/me/foo.pem")]

ssh_options[:keys] = [File.join(ENV["HOME"], "foo.pem")]

My last release:

# deploy.rb

set   :application,   "MyFirm"
set   :deploy_to,     "/var/www/myfirm.com"
set   :domain,        "dev.myfirm.com"

default_run_options[:pty] = true

set   :scm,           :git
set   :repository,    "[email protected]:/home/myfirm/myfirm.git"

set :ssh_options, {:forward_agent => true}

set :user, "ec2-user"
set :domain, "ec2-41-137-132-97.eu-west-1.compute.amazonaws.com"
ssh_options[:keys] = ["foo.pem"]


role  :web,           domain
role  :app,           domain
role  :db,            domain, :primary => true

set   :use_sudo,      false
set   :keep_releases, 3

set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads", "vendor"]
set :update_vendors, true
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文