micgeronimo
micgeronimo

Reputation: 2149

Trigger jenkins build in post-receive hook

I need to trigger jenkins build when commit is pushed to repository on bitbucket. Purpose of this is to assign reviewers for particular commit in bitbucket using jenkins build

Upvotes: 0

Views: 2065

Answers (1)

Eytan Avisror
Eytan Avisror

Reputation: 2970

There are two main options which are very simple to accomplish:

Use Bitbucket Webhook Jenkins Plugin

This will allow you to trigger a build on your Jenkins job as soon as commit is pushed to remote. However consider one major downside, this is actually being triggered via the Repo itself letting Jenkins know to trigger a build, which means if you have multiple jobs using the same repo they will ALL be triggered.

Use Webhook Post Receive Plugin

Personally I use this one, it will let you send a basic webhook to a given URL, which you can use with Jenkins' Trigger Remotely job option with Auth Token.

Upvotes: 2

Related Questions