Add Bitbucket as a code provider

February 24, 2020

Before you can install your application code in the cloud, you need to set up an integration between Smoothy and your Git provider. This allows Smoothy to automatically download your code from Git, build it into an executable binary, and roll out the latest version of your application, whenever you push new code changes to your Git repository.

This tutorial walks you step-by-step through the process of setting up an integration between your Bitbucket account and Smoothy.

The tutorial assumes that:

  1. You already have a Bitbucket account

warning

Please note that at this moment it is only possible to integrate your Bitbucket account if you have not enabled 2-factor authentication for your account. If this poses a major problem for your team, please send an email to [email protected] and we will see what we can do.

Add a Bitbucket code provider #

To integrate a new code provider, you should head over to your team's integration page. This is accessible via the button in the right upper corner of Smoothy, as shown in the screenshot below.

Team navigation

Hover the button in the upper right corner of the code providers table and click Add code provider.

Code providers

Next, a modal will appear, similar to the one in the screenshot below. In this modal, you have to select which code provider that you like to set up an integration with. Given the focus of this tutorial, this should be Bitbucket.

You also need to select who in your team will be able to use this code provider. You can choose between All team members and Only me.

When should you select which option?

  1. If your Bitbucket account contains only repositories that are accessible to all your team members, you should select the option All team members. This enables all your colleagues to browse through your Git repositories and install the contents of any repository on a server.
  2. If your Bitbucket account contains repositories that you don't want your colleagues to be able to deploy, you should select the option Only me. This way, your colleagues have no access to your Git repositories and only you can decide which Git repository to install on a server.

Finally, you can specify a name for your code provider. By default, Smoothy fills out this field for you so you can leave it untouched. However, if you have multiple Bitbucket integrations, you can assign each of them a distinctive name.

Integrate Bitbucket

In the next step of the process, you need to specify your Bitbucket credentials. To obtain these credentials, you can follow along with the steps below.

Integrate Bitbucket

First, head over to Bitbucket. Hover the profile picture in the lower-left corner of the screen and click on Bitbucket settings.

Integrate Bitbucket

On the settings page of your Bitbucket account, find the section Access management in the navigation on the left, and click on the menu item App passwords.

Integrate Bitbucket

On the App passwords page, you get an overview of all the passwords that you have generated for your account in the past. To generate a new password, click on the button labeled Create app password.

Integrate Bitbucket

This will open up a form in which you have to specify a label for your password. It is recommended to use the word Smoothy in the label so that you at a later point in time remember that this specific password was created to be used with Smoothy.

You also need to specify the permissions that you want to grant to the password. Similar to the screenshot below, you need to enable all the permissions under the Account section, the Read and Write permissions under the Repositories section, and the Read and write permission under the section Webhooks. All the other permissions can remain unchecked.

cool

This grants Smoothy full control over your public and private Bitbucket repositories. This is necessary to be able to download the source code of your applications and automate your deployment processes.

Integrate Bitbucket

As soon as you click Create, your new App password will appear. Copy this password to your clipboard.

Integrate Bitbucket

Next, you need to obtain your Bitbucket Workload id and Username. You can find these details on the Account settings page of your Bitbucket account. Navigate over there via the navigation on the left-hand side of the page.

Integrate Bitbucket

On this page, you find a section called Bitbucket profile settings. Right at the top of this section, you find your Workload id and Username. Copy these values to your clipboard and head back to Smoothy.

Integrate Bitbucket

Finally, paste your Workload id, Username, and App password in the respective fields and hit Create.

Integrate Bitbucket

Your new Bitbucket integration should now appear on your team's integrations page.

Where to go from here? #

Now that you have set up an integration between your Bitbucket account and Smoothy, you can turn the source code of your applications into an image. To do so, you can follow along with one of these tutorials.

Michiel Kempen

Michiel Kempen

A passionate cloud engineer who helps software companies adopt modern cloud technologies through an intelligent all-in-one cloud platform called Smoothy.