Capistrano和Git工作正常,直到我将我的网站移动到另一台服务器。由于SSH已知主机相关问题,我第一次部署尝试失败。Capistrano&Git:需要一个修订
即使我设法解决这个问题,另外一个凸起的和我不能部署更多:
* 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]:/home/collimarco/git/foto-fiori.git master" * executing "if [ -d /home/collimarco/mywebsite.com/shared/cached-copy ]; then cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e; else git clone --depth 1 [email protected]:/home/collimarco/git/foto-fiori.git /home/collimarco/mywebsite.com/shared/cached-copy && cd /home/collimarco/mywebsite.com/shared/cached-copy && git checkout -b deploy 7de27a6a1de7a94508f943596413e5e0f217f57e; fi" servers: ["mywebsite.com"] [mywebsite.com] executing command ** [mywebsite.com :: out] * refusing to create funny ref 'remotes/origin/*' locally ** [mywebsite.com :: out] [email protected]'s password: Password: ** [mywebsite.com :: out] ** [mywebsite.com :: out] fatal: Needed a single revision command finished *** [deploy:update_code] rolling back * executing "rm -rf /home/collimarco/mywebsite.com/releases/20091027191027; true" servers: ["mywebsite.com"] [mywebsite.com] executing command command finished failed: "sh -c \"if [ -d /home/collimarco/mywebsite.com/shared/cached-copy ]; then cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e; else git clone --depth 1 [email protected]:/home/collimarco/git/foto-fiori.git /home/collimarco/mywebsite.com/shared/cached-copy && cd /home/collimarco/mywebsite.com/shared/cached-copy && git checkout -b deploy 7de27a6a1de7a94508f943596413e5e0f217f57e; fi\"" on mywebsite.com
我的git仓库似乎完好无损:为什么我得到“需要一个单一版本”?
任何建议,非常感谢。 在此先感谢!
更新:有人建议删除远程缓存,我该怎么做?
更新:我已将shared/cached-copy重命名为shared/cached-copy-old。 然后我创建了一个共享/缓存复制空文件夹。 现在我得到“不是git仓库”: http://pastie.org/672254.txt
你有没有更新你的deploy.rb文件,我想你是的,但你介意发布相关的位?你使用的是什么版本的capistrano? – 2009-10-27 19:35:07
我使用Capistrano v2.5.2并且deploy.rb更新;) – collimarco 2009-10-27 19:44:41
只需删除shared/cached-copy。不要替换,帽子会为你做。 – 2009-10-27 21:11:18