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