Get started with Bitbucket Pipelines

We’re rolling out a new way of onboarding into Pipelines. In the following docs you can follow two different sets of steps to help you with your specific onboarding experience.

Get started with Pipelines

Bitbucket Pipelines is an integrated CI/CD service built into Bitbucket. It allows you to automatically build, test, and even deploy your code based on a configuration file in your repository. Essentially, we create containers in the cloud for you. Inside these containers, you can run commands (like you might on a local machine) but with all the advantages of a fresh system, customized and configured for your needs.

Understand the YAML file

A pipeline is defined using a YAML file called bitbucket-pipelines.yml, which is located at the root of your repository. For more information on configuring a YAML file, refer to Configure bitbucket-pipelines.yml.

Configure your first pipeline

There are two ways to configure your pipeline: you can either directly write the YAML file or you can use the UI wizard provided by Bitbucket. The steps below will guide you through the Pipelines configuration wizard.

Prerequisites

  • You need to have a Bitbucket Cloud account.

  • Your workspace must have at least one repository.

Steps

  1. In Bitbucket, go to your repository and select Pipelines.

  2. Click Create your first pipeline to scroll down to the template section.

  3. Choose one of the available templates. If you aren’t sure, you can use the one RECOMMENDED.

Templates cover a variety of use cases and technologies such as apps, microservices, mobile IaaC, and serverless development. We support major cloud providers such as AWS, Azure, and GCP. We support the top-used languages such as NodeJS, PHP, Java, Python, and .NET Core; however, based on the language configured in your Bitbucket repository, the template list automatically recommends templates in that language.

image_1

4. Once you choose a template, you will land in the YAML editor where you can configure your pipeline. Learn more about YAML syntax.

image2

Change template

You can change the template anytime by opening the dropdown and selecting a different template. Keep in mind that if you choose a new template, it will override the existing content.

 

image3

Add more steps

You can easily add more steps. Hover over the options in the steps panel and copy the code snippet, then add it to the editor.

 

image4

Add Pipes

Pipes allow you to easily configure a pipeline with third-party tools. Learn more about pipes.

To use a pipe you just have to select the pipe you want to use, copy, and paste the code snippet in the editor. There are dozens of pipes, see the full list by clicking Explore more pipes.

image5

Add variables

You can define custom variables that you can use in the YAML file. To add a variable, fill in the name, the value, check whether you want to encrypt it by clicking the secured box, and click Add.

image6

Outcome

Now that you’ve configured your first pipeline, you can always go back to the yaml editor by clicking the pipeline cog icon. Learn more about the Pipeline screen here.

Last modified on Nov 12, 2020
Cached at 8:29 AM on Nov 25, 2020 |

Additional Help

Ask the Community