Bitbucket Pipelines

As a back-end engineer, when you push code to the staging environment, you want to ensure that you don’t break the mobile app. Integrating Pipelines with buddybuild allows you to trigger automatic tests every time you push your back-end code.

Here’s how to get started!

Step 1: Onboard your app in buddybuild

Start by signing up with buddybuild using an existing service with Bitbucket.

sign up page bitbucket.png

Select your app and click build. In a few minutes, your app will be onboarded with buddybuild!

Bitbucket   Pipelines   2.png

Next, on the buddybuild dashboard, locate the branch you would like to enable tests for, and select the cog icon.

Builds   Branch Settings.png

When the branch configurations window appears, click on Test settings in the left navigation, then click on Configure.

Bitbucket   Pipelines   4.png

Turn on Run tests, and select one or more simulator devices. Buddybuild will now recognize any tests on the branch and automatically run them on every build!

Bitbucket   Pipelines   4b.png

Step 2: Set up Pipelines

To trigger a build in buddybuild, you can curl the buddybuild API endpoint. All you need is the access token and app ID. We recommend using Environment Variables to store these two values.

In your Source directory, create a file, and copy/paste the curl script below into it.


curl -X POST -H "Authorization: Bearer $BUDDYBUILD_TOKEN" "$BUDDYBUILD_APPID/build"

Next, set up environment variables for the buddybuild token and buddybuild app ID.

Bitbucket   Pipelines   5.png

Add BUDDYBUILD_TOKEN with your account token, and BUDDYBUILD_APPID with the App ID of your app. Not sure how to find it? Click here!

Bitbucket   Pipelines   7.png

Lastly, define your build and deployment instructions by modifying the bitbucketci.yml file. Add in the additional line that references the file to trigger a build.

Bitbucket   Pipelines   6.png

That’s all the setup that’s required! Now, whenever commits are made, builds automatically get kicked off in Pipelines and buddybuild.

results matching ""

    No results matching ""