我想爲我的應用做'deploy:cold'。 git repo是我的部署服務器的本地 (即,我只有一臺服務器,並且我不會在github上託管我的代碼)。Capistrano + Git:存儲庫本地到生產服務器
下面是全文(更換我的應用程序名稱以 「MYAPP」 隱私)
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote /home/mrichman/git/myapp.git master"
fatal: '/home/mrichman/git/myapp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/myapp.com/releases/20100218203108; true"
servers: ["myapp.com"]
Password:
[myapp.com] executing command
command finished
Command git ls-remote /home/mrichman/git/myapp.git master returned status code 32768
這裏是我的deploy.rb:http://pastie.org/831424
我也曾嘗試
set :repository, "[email protected]:/home/mrichman/git/myapp.git"
但那給了我
ssh: connect to host localhost port 22: Connection refused
任何想法表示讚賞。
我現在有以下,這也將失敗: 組:倉庫, 「文件:///var/git/myapp.git」 集:local_repository, 「本地主機:/var/git/myapp.git」 本地執行:「git ls-remote localhost:/var/git/hireexchange.git master」 ssh:連接到主機localhost端口22:連接被拒絕 – 2010-02-28 14:30:52
你在同一個盒子上開發嗎?如果你是我想象:local_repository,「file://var/git/myapp.git」將工作。 localhost應該替換爲您從假定的遠程工作站連接到的任何主機名。 此外,我發現如果你有子模塊,你會遇到更多的問題做這樣的部署,因爲模塊被設置爲指向一個遠程URL。 非常討厭,但可以在您部署的用戶下的服務器上使用.ssh/config來解決。 – pmarsh 2010-02-28 14:52:46
嗨,大家好。如果它有什麼區別,我的本地和遠程機器上的git需要不同的路徑,因此我需要設置:git_local/path/to/remote/git和set:git/usr/bin/git(注意這些不需要ssh開始)。 – btelles 2010-05-11 21:14:04