Bitbucket Builds in Webhook to Jenkins for Bitbucket

Mohammed Davoodi
Mohami Blog
Published in
5 min readApr 15, 2020

Given their extensive feature-set and sterling reputation, you can understand why development teams choose both Jenkins and Bitbucket to support DevOps, especially in continuous delivery and integration environments.

It’s a powerful duo, selected by high-performing teams for their extensive capabilities to automate the development process.

But what each can do on its own pales in comparison to what they can accomplish when they’re working together in lockstep.

Going Without Integration…

Even if you’re happy with your toolset, it’s important to ask whether you’re getting the maximum potential value out of your current tools. And since you’re happy with it, you might be asking whether maximum value even matters when things are working just fine.

But particularly when you’re running at continuous-delivery pace, you want your team to spend most of their time creating code, and to commit that code consistently and reliably. The more tedious that process is, the more resistance to maintaining the pace. How much is your team still pivoting between tools? How disruptive are the manual parts of the workflow requirements?

Your team may be humming along just fine without that additional connection between tools. It’s a question of priorities and vision — and understanding the power of taking that small step that can take a talented team from good to great.

… Or Making the Tools Part of the Team

You’d never put up with rogue team members who work well on their own, but not so much with others. If you think of tools as part of the team, playing pivotal roles, performing mission-critical tasks, there’s every reason for them to get with the program.

One prominent tool in the Atlassian ecosystem helps you do just that — Webhook to Jenkins (WJB). It’s a best-selling Bitbucket plugin that orchestrates all kinds of user-configurable triggers in Jenkins, automatically, based on key source control events.

WJB helps you leverage the strengths of two best-of-breed platforms — BitBucket and Jenkins.

How? WJB lets you set rules to trigger Jenkins tasks automatically, based on how your team uses Bitbucket — based on commits, based on particular tags and particular projects, and based on whether a commit includes actual changes to the code or not.

Want to trigger builds automatically on a commit? Do it reliably and without worrying whether your developers remembered to start a build under specific circumstances.

The plugin lets you automatically trigger a Jenkins build when:

… A pull request is opened

… A pull request reopened

… A pull request is merged

… repository refs change

The benefits of that kind of automation are real. It can make continuous integration/delivery environments run more smoothly, with less reliance on humans to do the tedious tasks that keep things running that way.

Even more useful, those actions can trigger unique pipelines on a per-project basis and particular team members can be excluded from triggering a notification. You can even use specific tags to determine which specific pipelines to trigger.

Jenkins Bitbucket Pipeline
Simple user Actions in Bitbucket can trigger pipelines in Jenkins based on user-defined rules

Key Features

A straightforward UI makes WJB easy to configure your hook on a project or repository level, and test your configuration and connectivity with a single click. You can add multiple Jenkins servers, trigger builds manually, whitelist/blacklist branches, ignore commits from specific users, and much more!

  • Configuration at multiple levels: Support for project and repository level configuration.
  • Multiple servers: From a single commit WJB can notify multiple Jenkins servers.
  • Set rules using multiple criteria: Support for build parameters, options to ignore certain committers, branches and tags. Ability to retrigger builds manually from the pull request screen.
  • Send custom information: You can also add your own parameters to send to Jenkins when a build is triggered — both your own custom parameters and information from the pull request to send to Jenkins.
  • Build Log display (NEW): See the build log right in Bitbucket without having to pivot to Jenkins.
  • Limit Events: Selectively limit events that trigger Jenkins, right down to the project level.
Limite Jenkins Trigger Events
  • Configuration testing: Easily test your configuration on the hook settings screen.
  • Bitbucket Mirrors: Support for Bitbucket Mirrors.

What’s New — Visibility, Not Just Automation

As good as it is, integration for automation purposes is only part of the story.

Even with the best tools in place, when the gears of automation mesh perfectly, your team can still find themselves pivoting between applications to see the information they need to do their jobs.

Now WJB gives users total visibility into that project, with an integrated display window showing the details of build execution.

The full build log is displayed in real-time, in its own window…

Mohami Build Log

For teams committed to a disciplined CI/CD process, using Bitbucket and Jenkins together just got even easier.

The better your toolset is running, the less you have to think about it, and the more you can focus on actually writing solid code.

Bitbucket Builds adds the real-time visibility that keeps the human element ‘in the loop’.

There’s no question that a disciplined CI/CD process relies more heavily on tools and automation than those that release in a cadence of predictable sprints. Not exactly a deep insight, but it’s a fact that’s given short shrift all too often, obscured in the fog of development.

The Bottom Line

There’s no right set of DevOps tools. Besides, your suite of supporting applications is almost always built piecemeal, evolving iteratively across thousands of development cycles.

Besides, the real question isn’t what Jenkins and Bitbucket can do better, it’s how they can boost productivity when they work better together. Working better with tools outside their ecosystem is where Atlassian plugins shine.

Start Now for Free

You can try the latest version of Webhook to Jenkins for Bitbucket right now… installation takes just seconds.

Requirements

Make sure you have the right prerequisites in place:

  • Jenkins with either the Git Plugin or Bitbucket Branch Source plugin installed.
  • The Webhook to Jenkins Server app installed on Bitbucket.

Getting the Plugin

Just go to the Atlassian Marketplace here and click Try it free.

Like all Mohami plugins, after installation, BBWJ ultimately leads development teams to the same result…

Mohami extends the Atlassian ecosphere with a suite of sensible, productivity-boosting plugins that plug key gaps in functionality, unlock integration between platforms, and streamline development.

Find more productivity-boosting plugins by visiting the Atlassian Marketplace here.

--

--

Mohammed Davoodi
Mohami Blog

CEO @Soteriaio, Formerly Founder & CEO @Mohamicorp (Acquired by Appfire), Flight Software Engineer @SpaceX, Software Developer @Amazon, @virginia_tech Alumni