Capistrano + Git:生产服务器本地的存储库

编程入门 行业动态 更新时间:2024-10-19 22:22:04
本文介绍了Capistrano + Git:生产服务器本地的存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序执行部署:冷".git repo 是本地的我的部署服务器(即我只有一台服务器来处理所有事情,而我不要在 github 上托管我的代码).

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).

这是成绩单(为了保护隐私,我的应用名称替换为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/releases/20100218203108; true"
    servers: ["myapp"]
Password:
    [myapp] executing command
    command finished
Command git ls-remote /home/mrichman/git/myapp.git master returned status code 32768

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

Here is my deploy.rb: http://pastie/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:生产服务器本地的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-31 03:19:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/794928.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器   Capistrano   Git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!