It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job to clone/fetch from Bitbucket Server, removing the need for multiple plugins/apps to achieve the same workflow. To try it out you need Bitbucket Server 5.5+ and Jenkins 2.162+

We’re keen to hear your feedback, so comment with questions, feedback, and feature requests and we’ll get back to you. If you’re interested you can also contribute to our plugin.

Cheers,

Imran Khan

Product Manager - Bitbucket Server

This plugin should not be used in a production environment yet. It is for feedback purposes only.

Bitbucket Server Integration with Jenkins CI - plugin features

  • supports Jenkins freestyle job type

  • provides a simple way for you to connect your Jenkins CI to Bitbucket Server instance

  • securely manage credentials inside Jenkins for cloning from Bitbucket Server

And in the coming weeks you’ll be able to:

  • automatically create a webhook inside a Bitbucket repo when a Jenkins job is saved

  • it will support Jenkins pipeline job type

  • select projects and repositories inside a Jenkins job through a dropdown

  • automatically send build statuses to commits and pull requests in Bitbucket Server

  • clone from Bitbucket Smart Mirrors without modifying the clone URL

If you’re ready to take it for a spin just follow the below steps:

Installing the plugin

  1. Download the HPI

  2. In Jenkins go to Jenkins > Manage Jenkins > Manage Plugins

  3. Select the Advanced tab

  4. Under Upload Plugin click Choose File

  5. Click Upload

Adding a linked Bitbucket Server instance

image-20190806-063145.png

After installing the plugin you need to configure at least one Bitbucket Server instance. To do this:

  1. In Jenkins go to Jenkins > Manage Jenkins > Configure System

  2. Under Bitbucket Server plugin click Add a Bitbucket instance

  3. Enter the instance details

Configuring the Jenkins job

image-20190806-064106.png

  1. Go to the Source Code Management section of the Jenkins freestyle job and select Bitbucket
  2. Select the existing credentials or add new to authenticate with Bitbucket Server. The credential should be of the type Username with password
  3. Select the Bitbucket instance
  4. Enter the project key and repository slug
  5. In the Build Triggers select Bitbucket Server trigger build after push
  6. Configure rest of your build steps and save the job

Triggering the Jenkins job

To trigger a build you need to manually create the webhook. This is a manual step in this alpha, but later versions will do this automatically. To do this:

  1. Log into Bitbucket as a user with repo admin permissions for the repo you want to build from

  2. Go to Repository settings > Webhooks

  3. Click Create webhook

  4. Enter a name for the webhook and a URL that follows the format {your-jenkins-instance}/bitbucket-server-webhook/trigger
  5. Select the repository event Push

  6. Click Create

When a new push happens the build will be triggered. You can then check the build info in Jenkins to see the changeset.

0 comments

Comment

Log in or Sign up to comment

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you