Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Bitbucket to Jenkins properly

Since about 1 week now, Bitbucket doesn't (?) send a request to my Jenkins server.

I've set it all up like this:

Endpoint http://username:apitoken@jenkinshost/
username = username in Jenkins
apitoken = apitoken connected to the username in Jenkins
jenkinshost = my host where I run Jenkins

Project name is a project
Token: The token I can setup in the per-project configuration.

I've done this according to this website: http://felixleong.com/blog/2012/02/hooking-bitbucket-up-with-jenkins.
It did work, but it doesn't anymore. Did Bitbucket change something? How can I fix this?

enter image description here

like image 264
Highmastdon Avatar asked May 12 '13 13:05

Highmastdon


People also ask

How do I connect to Bitbucket?

Create a connection to Bitbucket (console)Choose Settings > Connections, and then choose Create connection. To create a connection to a Bitbucket repository, under Select a provider, choose Bitbucket. In Connection name, enter the name for the connection that you want to create.


1 Answers

In order to build your repo after new commits, use Bitbucket Plugin.

There is just one thing to notice: When creating a POST Hook (notice that it is POST hook, not Jenkins hook), the URL works when it has a "/" in the end. Like:

URL: JENKINS_URL/bitbucket-hook/ e.g. someAddress:8080/bitbucket-hook/ 

Do not forget to check "Build when a change is pushed to Bitbucket" in your job configuration.

like image 119
mohi Avatar answered Sep 17 '22 13:09

mohi