Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial build on push

I'd like for a build to be done (on the server) each time a push is made to our central Mercurial repository. Builds are usually kicked off on our build server by running a Visual Build file either manually or via a scheduled task.

What are the ways of achieving this?

Simple, low impact solutions are preferred.

like image 251
CiscoIPPhone Avatar asked Dec 14 '10 16:12

CiscoIPPhone


2 Answers

As Pablo suggested, you can do this with a hook, but you'll need an incoming hook on the server side. This hook runs "after a changeset has been pulled, pushed, or unbundled into the local repository" (hgrc manpage).

Edit the .hg/hgrc file of the repository located on the server and define your build hook as follows:

[hooks]
incoming = /path/to/executable-build-script

Of course, the build script called here just needs to be a trigger for whatever build process you actually use.

Note that an incoming hook runs for every single changeset in a push. If you don't want this, use a changegroup hook -- it runs only once for each push, no matter how many changesets it carries.

like image 124
Oben Sonne Avatar answered Nov 14 '22 15:11

Oben Sonne


Another way, in addition to the hooks that Pablo mentions, is to set up a continuous integration server, like TeamCity. Then you could ask TeamCity to monitor your repository, pull new changesets and start the visual build script for you.

like image 32
Lasse V. Karlsen Avatar answered Nov 14 '22 15:11

Lasse V. Karlsen