SAID Med Bechir
SAID Med Bechir

Reputation: 109

How to build Jenkins after each push in any branch?

Is there any way to make Jenkins builds after each commit in any branch ? Because i found in my project's configuration that Jenkins run build only after detecting commits in specific branch or in the default ( eq to master in git ). PS: i'm using mercurial and Jenkins file. Should i change project type ( new item type in Jenkins ) or are there any modifications in configs.

Upvotes: 0

Views: 734

Answers (2)

SAID Med Bechir
SAID Med Bechir

Reputation: 109

I got this solution and it worked for me. with Mercurial, we can use the "tip" keyword.The tip revision is the most recent changeset in the repository. It is the most recently changed head.

Upvotes: 0

mndrye
mndrye

Reputation: 529

There are two things that you should check for this (I haven't work with Mercurial)

  • Does Mercurial has the option to create webhooks?
  • There is a jenkins plugin for Mercurial? (I think there is)

You must configure on the mercurial site the webhook pointing to Jenkins and give the point to the job you want to run, and on which events does it will fire. On the Jenkins side you must configure on the job who it will behave.

For example, with GitLab, the plugin has an option configured on the "Build Trigger" section where you configure the events and the branches that fires the job. In GitLab, in the repository you create the webhook, that is only a URL pointing to the Jenkins job.

Upvotes: 1

Related Questions