Trigger a jenkins build from git using cloudbees and bitbucket

I’m trying to trigger a jenkins build automatically when i commit to my git repo. I am using a cloudbees jenkins instance and my repo is located at butbucket.

I configured the jenkins service on my bitbucket repo but it doesn’t seem to start the build on jenkins. To configure it i’ve used the following:

  • How to create digital object identifier (DOI) for bitbucket repository?
  • How to add TAG to a already committed in Git and Bitbucket
  • How to properly configure ssh keys to multiple remote accounts involving github and bitbucket?
  • Connect to Bitbucket Git SSH Public Key
  • NetBeans + Git on BitBucket
  • git archive command with bitbucket
  • Endpoint: https://<my-email>:<my-api-token>
    Project name: <my-build-job-name>
    Token: <my-token-name>

    I have properly set up both the cloudbees SSH public key to bitbucket and verified that jenkins does build my project successfully when triggered manually. It doesn’t seem to work however when i push changes to my repository.

    I have followed the following tutorial:

    Has anyone managed to solve this?

  • What is the difference between Hudson and CruiseControl for Java projects?
  • bibucket ssh_exchange_identification: read: Connection reset by peer
  • How to import Github issues and wikis to BitBucket?
  • How do I get Jenkins to skip failed branches till they change?
  • How to update code from git to a Docker container
  • Connect to Bitbucket Git SSH Public Key
  • 3 Solutions collect form web for “Trigger a jenkins build from git using cloudbees and bitbucket”

    I also followed the CloudBees BitBucket Tutorial
    but what I found is that I had skipped a step as it had been in french.

    The step was to check (in the Jenkins Configuration) the Trigger builds remotely (e.g., from scripts) checkbox and ensure that the Authentication Token given is the same Token that is given to the BitBucket Service. This, as the tutorial says, is where “the magic will occur”.

    I wrote this doc about intergating bitbucket with jenkins on Cloudbees, but bitbucket don’t officially support credentials on service hooks, and this doesn’t seem to work for ALL accounts, even I can’t tell why it sometimes fails. Cloudbees instance just never receive the notification http request with credentials set.

    Maybe a bitbucket plugin would help, as we have for github and gitlab to manage commit hooks.

    I posted a related solution here for others who happen to land on this page.

    Git Baby is a git and github fan, let's start git clone.