Getting started with Bitbucket Pipelines in Sourcetree

By on November 30, 2017

Modern software development practices like CI/CD and DevOps help the whole team be responsible for code quality. However, success in this environment depends on important information being accessible to everyone, instantly. Our Sourcetree team has taken this idea to heart in macOS by providing greater visibility into your builds, giving you more context and confidence in the quality of your code.

All you need to get started is a Bitbucket Cloud account, with Bitbucket Pipelines enabled, and you’ll be viewing the status of builds in Sourcetree in no time!

Let’s walk through how to make this happen.

Sign up for Bitbucket Cloud

Our Sourcetree integration with Bitbucket Cloud now provides visibility into the status of your builds.

Bitbucket Cloud is distributed version control, code review, continuous integration, and much more for software teams across the globe. Bitbucket Cloud includes free unlimited private repositories with nearly an hour of build time per month to enjoy built-in continuous delivery with Bitbucket Pipelines.

Step one of seeing build status in Sourcetree is signing up for a Bitbucket Cloud account.

For those with a Bitbucket Cloud account already, feel free to skip to the next section. If you’ve just signed up for a Bitbucket Cloud account, follow these instructions to import an existing repository of yours – you won’t be able to enable Bitbucket Pipelines and build without one!

Getting started with Bitbucket Pipelines

Bitbucket Pipelines empowers teams to build, test, and deploy their code directly within Bitbucket Cloud.

Here’s how to get your first build in your repository in 3 simple steps:

Step 1 Click the Pipelines icon, then click Start using Pipelines to access our language templates.

Note: Pipelines won’t work with an empty repository so you’ll need to add at least one file to get Pipelines building.

Step 2 Choose a language template and edit the bitbucket-pipelines.yml file which defines your build.

Step 3 Click Commit file and watch Pipelines start building.

If you don’t want to use the wizard to commit the file or you want to test the configuration locally first, check out this guide for more information.

Viewing build status in Sourcetree

Now that you’ve got Bitbucket Pipelines enabled in your Bitbucket Cloud repository, the last and final step to see build status in Sourcetree is to add the repository (or pull the changes) in Sourcetree.

Step 1 Navigate to Preferences → Accounts, click Add, and fill in the details in the dialog.

Step 2 Open the repository you enabled Pipelines on from the Repository Browser, or by using Cmd + O to select it on disk.

Step 3 Click Pull in the toolbar or use Repository → Pull… from the main menu.

And that’s it! You can now see the status of builds for a commit without having to leave Sourcetree. If you’re stuck at all head over to the Atlassian Community for some help getting up and running.