如何通过Mercurial将代码推送到多个服务器? [英] How to push code to multiple servers by Mercurial?

查看:90
本文介绍了如何通过Mercurial将代码推送到多个服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何将代码推送到多个服务器?我们有许多服务器需要具有相同的代码副本.很难推送到单个服务器.我知道水星有钩子,但没有一个能提供适当的解决方案.

How can we push code to multiple servers? We have many servers which needs to have the same copy of the code. It is difficult to push to individual server. I know mercurial has hooks but none of them gives a proper solution.

推荐答案

在中央服务器中,您创建一个

In your central server you create a changegroup hook.

因此您的中央服务器将具有以下hgrc:

So your central server would have the following hgrc:

[paths]
server2=http://server2
server3=http://server3
[hooks]
changegroup.server2 = hg push -f server2
changegroup.server3 = hg push -f server3

您可以为同一事件设置多个钩子,所以这不成问题.
与变更集挂钩相比,变更组挂钩的优势在于它的运行频率要低得多.

You can have multiple hooks for the same event, so that shouldn't be an issue.
The advantage of the changegroup hook over the changeset hook is that it is run far less often.

这篇关于如何通过Mercurial将代码推送到多个服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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