用capistrano与远程git repo部署,但不在生产服务器上运行git [英] deploying with capistrano with remote git repo but without git running on production server

查看:109
本文介绍了用capistrano与远程git repo部署,但不在生产服务器上运行git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队中有一个远程git存储库,用于集中开发。但是,我们目前部署应用程序的生产服务器没有运行git。我们希望使用capistrano来部署我们的应用程序我们如何设置我们的部署配方,以便在部署时从远程git存储库'拉出来'?换句话说,我可以做些什么像这样?

  set:repository,myserver.com/git/#{application}.git
set:scm,git
set:deploy_via,:copy


解决方案

您问题中的解决方案接近正确。不过,你需要指定你的git仓库。你需要的是:

pre $ lt; code> set:repository,someuser @ somehost:/ home / myproject
set:scm ,git
set:deploy_via,:copy

还有更多关于如何设置在下的Capistrano gem中部署git部署 lib / capistrano / recipes / deploy / scm / git.rb

使用 copy 部署策略是Capistrano克隆你的git repo到本地机器上的 / tmp ,tars&压缩结果,然后通过sftp将其传输到服务器。复制策略也支持通过scp进行复制,但是没有办法告诉它在没有对源代码进行黑客入侵的情况下这样做。


I have a remote git repository setup for centralized development within my team. However, the production server that we deploy our applications currently does not have git running on it. We want to use capistrano to deploy our applications how can we set up our deploy recipes to 'pull' from the remote git repositories when deploying?

In other words can I do something like this?

set :repository, "myserver.com/git/#{application}.git"
set :scm, "git"
set :deploy_via, :copy

解决方案

The solution in your question is close to correct. You'll need to specify your git repository a little differently, though. What you need is:

set :repository, "someuser@somehost:/home/myproject"
set :scm, "git"
set :deploy_via, :copy

There's more examples of how to set up git deployment in your Capistrano gem under lib/capistrano/recipes/deploy/scm/git.rb.

What happens when you use the copy deploy strategy is that Capistrano clones your git repo to /tmp on your local machine, tars & zips the result, and then transfers it to the server via sftp. The copy strategy also supports copying via scp, but there's no way to tell it to do that without hacking around in the source a bit.

这篇关于用capistrano与远程git repo部署,但不在生产服务器上运行git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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