Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push code to multiple servers by Mercurial?

Tags:

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.

like image 957
Akshay Avatar asked Jul 21 '10 10:07

Akshay


1 Answers

In your central server you create a changegroup hook.

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.

like image 192
Ton Plomp Avatar answered Sep 30 '22 18:09

Ton Plomp