问题描述
我正在尝试为我的应用程序执行部署:冷".git repo 是本地的我的部署服务器(即我只有一台服务器来处理所有事情,而我不要在 github 上托管我的代码).
I am trying to do 'deploy:cold' for my app. The git repo is local tomy deployment server (i.e. I only have one server for everything and Idon't host my code on github).
这是成绩单(为了保护隐私,我的应用名称替换为myapp")
Here is the transcript (replaced my app name with "myapp" for privacy)
* 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
Here is my deploy.rb: http://pastie.org/831424
我也试过
set :repository, "deploy@localhost:/home/mrichman/git/myapp.git"
但这给了我
ssh: connect to host localhost port 22: Connection refused
感谢任何想法.
推荐答案
刚遇到同样的问题.关键是不要使用 deploy_via copy 而是设置 :local_repository
Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository
这应该设置为您用于从开发计算机/笔记本电脑访问存储库的 URL.
This should be set to the URL you use to access the repository from your development computer/laptop.
我的也有
set :repository, "file:///srv/git/myapp.git"
set :local_repository, "nameOfHostFromSSHConfig:/srv/git/myapp.git"
似乎奏效了.请记住,然后删除 deploy_via 复制行.
Seems to have worked. Just remember to then remove the deploy_via copy line as well.
这篇关于Capistrano + Git:生产服务器本地的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!