Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let Jenkins build project from a Mercurial commit

Is there a way to specify a hook in the single repository?

Now we have specified the hook in the "/etc/mercurial/hgrc" file, but every time it builds twice, and it builds for each commit in each repository.

So we want to specify a build per repository.

This is how we implemented the hook:

[hooks]
changegroup = curl --silent http://jenkins:8080/job/ourProject/build

It's on a Ubuntu server.

like image 759
MemLeak Avatar asked Oct 10 '13 14:10

MemLeak


1 Answers

  1. Select the Poll SCM option under Build Triggers.
  2. Make sure that schedule form is empty.

You should be creating in the .hg directory, /home/user/mercurial/.hg/hgrc and add hooks as:

[hooks]
commit.jenkins = wget -q http://localhost:8080/mercurial/notifyCommit?url=file:///home/user/mercurial > /dev/null
incoming.jenkins = wget -q http://localhost:8080/mercurial/notifyCommit?url=file:///home/user/mercurial > /dev/null
like image 66
TEDDY Avatar answered Oct 11 '22 10:10

TEDDY