我正在尝试基于 capifony 和 Symfony2 做一个 Symfony 2 项目部署 Web 应用程序。
它使用 Process 来触发我的“cap deploy”任务并在 Web 浏览器中显示我的输出。
在 shell 中,如果我以用户 www-data(与 Process 使用的相同)身份运行“cap deploy”,我的部署工作正常,因此我的部署任务和身份验证密钥都没有问题。但是,当我从我的网络应用程序调用我的任务时,capifony 告诉我它无法在远程服务器上进行身份验证。
triggering start callbacks for `deploy'
* executing `deploy:setdomain'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
triggering before callbacks for `deploy:update_code'
[32m--> Updating code base with checkout strategy[0m
executing locally: "git ls-remote [ myrepo ]"
command finished in 2068ms
* executing "git clone -q -o [ remote server ] [ my repo ]
/var/www/spinfony/releases/20121211100449 && cd /var/www/spinfony/releases/20121211100449 && git checkout -q -b deploy be53233e51a4c542c3bc8603b424e57f988898a4 && (echo be53233e51a4c542c3bc8603b424e57f988898a4 > /var/www/spinfony/releases/20121211100449/REVISION)"
servers: ["[ remote server ]"]
Password: stty: standard input: Invalid argument
stty: standard input: Invalid argument
stty: standard input: Invalid argument
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/spinfony/releases/20121211100449; true"
servers: ["[ remote server ]"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: [ remote server ] (Net::SSH::AuthenticationFailed: [ user ])
connection failed for: [ remote server ] (Net::SSH::AuthenticationFailed: [ user ])
我试图弄清楚为什么 capifony 似乎期望一个我无法提供的密码,因为我没有从 shell 运行它,而当我从 shell 运行它时,它可以正常工作而无需询问我任何东西。
再一次,从同一个用户调用同一个文件。