我正在使用Ruby on Rails 3.0.9,并试图设置Capistrano创业板(下面的敏捷Web开发与导轨书 - 第四版)。我在远程机器上设置了git和所有相关目录\文件(它工作)以及与Capistrano相关的所有“基本”事情。现在,如果我从我的本地机器上运行下面的命令,如预期的工作:在服务器上部署与Capistrano
cap deploy:setup
# ...
cap deploy:check
# ...
# You appear to have all necessary dependencies installed
这时我的项目目录中,我有以下目录(由Capistrano的创建):
<my_project_dir>/releases
<my_project_dir>/shared
没有更多。
我现在应该做什么?例如,我是否需要将所有应用程序文件从本地计算机上传到远程计算机?
P.S .:我也设置我的Apache2服务器指向<my_project_dir>/current/public
目录,但Capistrano没有创建该文件夹。
UPDATE为@Alex
如果我运行cap deploy
命令我得到以下几点:
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git master"
command finished in 3086ms
* executing "if [ -d /srv/www/<my_project_name>.com/shared/cached-copy ]; then cd /srv/www/<my_project_name>.com/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1 && git clean -q -d -x -f; else git clone -q [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git /srv/www/<my_project_name>.com/shared/cached-copy && cd /srv/www/<my_project_name>.com/shared/cached-copy && git checkout -q -b deploy 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1; fi"
servers: ["<SERVER_IP_ADDRESS>"]
[<SERVER_IP_ADDRESS>] executing command
** [<SERVER_IP_ADDRESS> :: err] Host key verification failed.
** [<SERVER_IP_ADDRESS> :: err] fatal: The remote end hung up unexpectedly
command finished in 396ms
*** [deploy:update_code] rolling back
* executing "rm -rf /srv/www/<my_project_name>.com/releases/20110820175634; true"
servers: ["<SERVER_IP_ADDRESS>"]
[<SERVER_IP_ADDRESS>] executing command
command finished in 353ms
failed: "sh -c 'if [ -d /srv/www/<my_project_name>.com/shared/cached-copy ]; then cd /srv/www/<my_project_name>.com/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1 && git clean -q -d -x -f; else git clone -q [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git /srv/www/<my_project_name>.com/shared/cached-copy && cd /srv/www/<my_project_name>.com/shared/cached-copy && git checkout -q -b deploy 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1; fi'" on <SERVER_IP_ADDRESS>
注:failed: ...
在最后一行。问题是什么?
你有没有尝试帽部署? – Alex
@Alex - 我更新了问题。 – Backo
您是否使用公钥/私钥对使用SSH访问机器? – Alex