1

我在 /Sites/mywebsite 中有我的 Symfony2.1 网站文件夹,其中有 git。我想使用 capifony 将我的网站快速部署到我的远程服务器(我目前正在使用 ftp)。所以我安装了 capifony,并在我的项目中使用启动 capifonycapifony .

我使用这里描述的第二种解决方案http://capifony.org/(部署->通过复制生产),所以我像这样设置我的deploy.rb文件:

set :application, "mywebsite"
set :domain,      "199.178.832.3:8534"
set :deploy_to,   "git/mywebsite.git"
set :app_path,    "app"

set :repository,  "file:///Users/me/Sites/mywebsite"
set :scm,         :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`

set :model_manager, "doctrine"
# Or: `propel`

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain                         # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Symfony2 migrations will run

set :use_composer, true

set :use_sudo,      false
set :keep_releases,  3
set :shared_files,      ["app/config/parameters.yml"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads", "vendor"]

set :deploy_via, :rsync_with_remote_cache
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["~/.ssh/id_rsa"]

# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL

但是当我运行时cap deploy:setup,出现以下错误:

  * 2013-03-19 10:52:06 executing `deploy:setup'
  * executing "mkdir -p git/mywebsite.git git/mywebsite.git/releases git/mywebsite.git/shared"
    servers: ["199.178.832.3"]
Password: 
connection failed for: 199.178.832.3:8534 (Net::SSH::AuthenticationFailed: me)

它要求输入密码,我不明白是哪一个以及为什么,因为我将我的公钥添加到我的远程服务器中的 authorized_keys 并且我没有为此公钥设置密码。

4

1 回答 1

0

确保您可以使用该密钥和用户名自己通过 SSH 连接me。如果仍然是同样的问题,则启用更详细的输出并启用Pseudo Terminal

ssh_options[:verbose] = :debug
default_run_options[:pty] = true
于 2013-03-19T21:00:12.607 回答