Capistrano + Git:存储库本地到生产服务器 [英] Capistrano + Git : repository local to production server

查看:138
本文介绍了Capistrano + Git:存储库本地到生产服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的应用程序做部署:冷。 git repo是本地的
我的部署服务器(即我只有一个服务器的一切,我
不托管我的代码在github)。



这是抄本(将我的应用程序名称替换为myapp用于隐私)

  *执行deploy:cold 
*执行`deploy:update'
** transaction:start
*执行`deploy:update_code'
本地执行:git ls-remote / home / mrichman / git / myapp.git主人
致命:'/home/mrichman/git/myapp.git'似乎不是一个git仓库
致命:远程端挂起意外
*** [部署:update_code]回滚
*执行rm -rf /var/www/myapp.com/releases/20100218203108; true
servers:[myapp.com]
密码:
[myapp.com]执行命令
命令完成
命令git ls-remote /home/mrichman/git/myapp.git master返回状态码32768

这是我的deploy.rb: http://pastie.org/831424



我也尝试过

  set:repository,deploy @ localhost:/home/mrichman/git/myapp.git

但是这给了我

  ssh:connect to主机本地主机端口22:连接拒绝

任何想法都赞赏。

解决方案

刚刚遇到同样的问题。关键是不要使用deploy_via副本,而是设置:local_repository



这应该设置为用于从开发计算机/笔记本电脑访问存储库的URL。 p>

所以我的

  set:repository,file:/// srv / git / myapp.git
set:local_repository,nameOfHostFromSSHConfig:/srv/git/myapp.git

似乎有工作。只需记住,然后删除deploy_via复制行。


I am trying to do 'deploy:cold' for my app. The git repo is local to my deployment server (i.e. I only have one server for everything and I don't host my code on github).

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

Here is my deploy.rb: http://pastie.org/831424

I have also tried

set :repository, "deploy@localhost:/home/mrichman/git/myapp.git"

but that gives me

ssh: connect to host localhost port 22: Connection refused

Any ideas are appreciated.

解决方案

Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository

This should be set to the URL you use to access the repository from your development computer/laptop.

So mine has

set :repository, "file:///srv/git/myapp.git"
set :local_repository, "nameOfHostFromSSHConfig:/srv/git/myapp.git"

Seems to have worked. Just remember to then remove the deploy_via copy line as well.

这篇关于Capistrano + Git:存储库本地到生产服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆