Bitbucket Pipelines
The Buildkite migration tool helps you convert your Bitbucket pipelines into Buildkite pipelines. This page lists the Buildkite migration tool's currently supported, partially supported, and unsupported keys (known as properties in Bitbucket Pipelines) when translating from Bitbucket pipelines to Buildkite pipelines.
For any partially supported and unsupported Keys listed in the tables on this page, you should follow the instructions provided in their relevant Notes, for details on how to successfully complete their translation into a working Buildkite pipeline.
The Bitbucket Pipeline configuration that is referred to in various sections below is specified in the central bitbucket-pipelines.yml
within a specific Bitbucket workspace repository. In Buildkite, the pipeline configuration can be set in a singular pipeline.yml
within a repository or it can also be set and uploaded dynamically through the use of Dynamic Pipelines. Additionally, control and governance of Buildkite pipelines can be achieved through the use of Pipeline Templates to set shared pipeline configuration within a Buildkite organization.
Using the Buildkite migration tool with Bitbucket
To start converting your Bitbucket pipeline into Buildkite Pipelines format:
- Open the Buildkite migration interactive web tool in a new browser tab.
- Select Bitbucket Pipelines at the top of the left panel.
- Copy your Bitbucket pipeline configuration and paste it into the left panel.
- Select Convert to reveal the translated pipeline configuration in the Buildkite Pipeline panel.
For example, when converting the following example Bitbucket pipeline configuration:
image: node:18
pipelines:
default:
- step:
name: Build
script:
- npm install
The Buildkite migration tool should translate this to the following output:
---
steps:
- commands:
- npm install
plugins:
- docker#v5.10.0:
image: node:18
label: Build
The Buildkite migration tool interface should look similar to this:
You might need to adjust the converted Buildkite pipeline output to ensure it is consistent with the step configuration conventions used in Buildkite Pipelines.
Remember that not all the features of Bitbucket can be fully converted to the Buildkite Pipelines format. See the following sections to learn more about the compatibility, workarounds, and limitation of converting Bitbucket pipelines to Buildkite Pipelines.
Clone
Bitbucket Pipelines' clone
property provides options for controlling how a repository is cloned during a build.
Key |
Supported | Notes | |||
---|---|---|---|---|---|
Key |
clone |
Supported | Partially | Notes | Clone options for all steps of a Bitbucket pipeline. The majority of these options need to be set on a Buildkite Agent itself through its configuration of properties such as the clone flags (git-clone-flags or git-clone-mirror-flags if utilizing a Git mirror), fetch flags (git-fetch-flags ) - or changing the entire checkout process in a customized plugin overriding the default agent checkout hook. Sparse-checkout properties of code-mode , enabled , and patterns used in a Bitbucket pipeline will be translated to the respective properties within the sparse-checkout-buildkite-plugin. clone properties in a Bitbucket pipeline have higher precedence over these global properties. |
Definitions
Bitbucket Pipelines' definitions
property is used to define resources used elsewhere in a pipeline configuration.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
definitions
|
Supported |
Partially |
Notes |
Customized definitions utilized in a Bitbucket pipeline. |
Key |
definitions.caches
|
Supported |
Partially |
Notes |
Customized cache definitions that can be applied to specific Bitbucket pipeline steps - inclusive of folders, single file-cache, or multi-file cache. Targeted into specific steps with the |
Key |
definitions.caches.<name>
|
Supported |
Yes |
Notes |
A customized cache name applicable to one or more steps within a Bitbucket pipeline. |
Key |
definitions.caches.<name>.path
|
Supported |
Yes |
Notes |
The path to a directory that needs to be cached. |
Key |
definitions.caches.<name>.key.files
|
Supported |
Partially |
Notes |
The list of (one or more) files that are monitored for changes, and stored once the hash changes between file version changes. If multiple files are specified, then multiple cache-plugin definitions are set on the resulting Buildkite Pipelines command step (so the |
Key |
definitions.pipeline
|
Supported |
Partially |
Notes |
Pipelines that are exported for reuse within the repositories of the same workspace. Similar functionality exists within Buildkite Pipelines, called Pipeline templates. |
Key |
definitions.services
|
Supported |
Partially |
Notes |
Docker services that are defined and applied within a Bitbucket pipeline. Services defined in a corresponding Bitbucket pipeline step using the |
Export
Key |
Supported | Notes | |||
---|---|---|---|---|---|
Key |
export |
Supported | No | Notes | Bitbucket Premium option for sharing pipeline configurations between workspaces. Not applicable within Buildkite as an attribute. However, similar functionality exists in Buildkite Pipelines using Pipeline templates. |
Image
Bitbucket Pipelines' image
property is used to specify public images or private images, and supports a number of sub-properties.
Key |
Supported | Notes | |||
---|---|---|---|---|---|
Key |
image |
Supported | Yes | Notes | The container image that applies to each step within a Bitbucket pipeline, using the image specified within the docker-buildkite-plugin. This has a lower precedence over a per-step image configuration (see pipelines.default.step.image ). |
Key |
image.aws image.aws.oidc image.name image.username image.password
|
Supported | Partially | Notes | Supported through the use of the corresponding plugin (Docker Login or ECR). |
Options
Bitbucket Pipelines' options
property contains global settings that apply throughout a pipeline, or all of a repository's pipelines.
Key |
Supported | Notes | |||
---|---|---|---|---|---|
Key |
options |
Supported | Partially | Notes | Customized options utilized throughout a Bitbucket pipeline. |
Key |
options.max-time |
Supported | Partially | Notes | This property is supported for translation within the Buildkite migration tool into the generated Buildkite Pipelines command step's timeout_in_minutes . |
Key |
options.size |
Supported | Partially | Notes | This property is supported for translation within the Buildkite migration tool into the generated Buildkite Pipelines command step's agent tag. |
Key |
options.docker |
Supported | No | Notes | This property is not supported and will depend on the agent configuration the corresponding Buildkite Pipelines command step is being targeted to run said job has available. |
Note that both of these partially supported properties, when defined at the Bitbucket pipeline step-level, will have a higher precedence than when these properties are set at options
level.
Pipeline starting conditions
Bitbucket Pipelines allows the configuration of various pipeline start conditions, with each condition supporting different configurations and permissible properties, listed in the following set of tables, such as branches
, custom
, default
, pull-requests
, and tags
.
Branches
Bitbucket Pipelines' branches
property defines all branch-specific build pipelines.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.branches
|
Supported |
Yes |
Notes |
Application of a specific Bitbucket pipeline configuration for specific branches. Translated to a step conditional in the corresponding Buildkite pipeline utilizing the |
Key |
pipelines.branches.<branch>
|
Supported |
Yes |
Notes |
The branch name or a wildcard where a specific Bitbucket pipeline step configuration needs to be applied. |
Key |
pipelines.branches.<branch>.parallel
|
Supported |
Yes |
Notes |
Parallel (concurrent) step configuration for a specific branch within a Bitbucket pipeline. See more information regarding the available pipeline parallel properties supported by the Buildkite migration tool and additional property information in the Bitbucket Pipelines' Parallel step options documentation. |
Key |
pipelines.branches.<branch>.step
|
Supported |
Yes |
Notes |
Individual step configuration for a specific branch within a Bitbucket pipeline. See more information regarding the available pipeline step properties supported by the migration tool, and additional property information in the Bitbucket Pipelines' Step property options documentation. |
Key |
pipelines.branches.<branch>.stage
|
Supported |
Yes |
Notes |
Stage configuration for a specific branch within a Bitbucket pipeline. See the available pipeline stage properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Stage options documentation. |
Custom
Bitbucket Pipelines' custom
property is used to define pipelines that can only be triggered manually.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.custom
|
Supported |
Yes |
Notes |
Bitbucket pipelines that can only be triggered manually. The corresponding Buildkite pipeline is first generated with an input step before any command jobs, to ensure that the triggered builds are processed manually. |
Key |
pipelines.custom.<name>
|
Supported |
Yes |
Notes |
The name of the custom Bitbucket pipeline. |
Key |
pipelines.custom.<name>.import-pipeline.import
|
Supported |
No |
Notes |
The specification of importing a pipeline from within a specific repository defined in top-level |
Key |
pipelines.custom.<name>.parallel
|
Supported |
Yes |
Notes |
Parallel (concurrent) step configuration for a custom Bitbucket pipeline. See the available pipeline parallel properties supported by the Buildkite migration tool as well as the additional property information in the Bitbucket Pipelines' Parallel step options documentation. |
Key |
pipelines.custom.<name>.stage
|
Supported |
Yes |
Notes |
Stage configuration for a custom Bitbucket pipeline. See the available pipeline stage properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Stage options documentation. |
Key |
pipelines.custom.<name>.step
|
Supported |
Yes |
Notes |
Individual step configuration for a custom Bitbucket pipeline. See the available pipeline step properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Step property options documentation. |
Key |
pipelines.custom.<name>.variables
|
Supported |
Partially |
Notes |
Variable configuration for a custom Bitbucket pipeline. See the available pipeline variable properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Custom (manual) pipeline variables documenation. |
Default
Bitbucket Pipelines' default
property contains the pipeline definition for all branches that don't match a pipeline definition in other sections.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.default
|
Supported |
Yes |
Notes |
Bitbucket pipeline configuration that does not meet a specific condition. |
Key |
pipelines.default.parallel
|
Supported |
Yes |
Notes |
Parallel (concurrent step) configuration for default Bitbucket pipelines. See the available pipeline parallel properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Parallel step options documentation. |
Key |
pipelines.default.stage
|
Supported |
Yes |
Notes |
Stage configuration for default Bitbucket pipelines. See the available pipeline stage properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Stage options documentation. |
Key |
pipelines.default.step
|
Supported |
Yes |
Notes |
Individual step configuration for default Bitbucket pipelines. See the available pipeline step properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Step property options documentation. |
Pull requests
Bitbucket Pipelines' pull-requests
property defines pipelines that only run when a pull request is created.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.pull-requests
|
Supported |
Yes |
Notes |
Application of specific Bitbucket pipeline configuration based for pull requests. Translated to a step conditional in the corresponding Buildkite pipeline utilizing the |
Key |
pipelines.pull-requests.<branch>
|
Supported |
Yes |
Notes |
The base branch name or a wildcard to be applied within a specific Bitbucket pipeline step configuration. To apply the configuration for all builds, use a |
Key |
pipelines.pull-requests.<branch>.parallel
|
Supported |
Yes |
Notes |
Parallel (concurrent) step configuration for pull request builds of a Bitbucket pipeline. See the available pipeline parallel properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Parallel step options documentation. |
Key |
pipelines.pull-requests.<branch>.stage
|
Supported |
Yes |
Notes |
Stage configuration for pull request builds of a Bitbucket pipelines. See the available pipeline stage properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Stage options documentation. |
Key |
pipelines.pull-requests.<branch>.step
|
Supported |
Yes |
Notes |
Individual step configuration for pull requests builds within a Bitbucket pipeline. See the available pipeline step properties supported by the Buildkite migration tool, and additional property information in the Bitbucket Pipelines' Step property options documentation. |
Pipeline properties
Each pipeline starting condition in Bitbucket can support various pipeline properties like parallel
, step
, stage
, and variables
.
Additionally, implementation of these pipeline properties can be enhanced with best practices by using dynamic pipelines to generate and upload pipeline configuration dynamically and using conditionals at both pipeline level and step level to apply jobs only when certain conditions are met, and setting trigger steps with required attributes and environment variable configurations passed through to the triggered builds.
Parallel
Bitbucket Pipelines' parallel
step options allow faster building and testing of code by running a list of steps concurrently.
Key |
Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.<start-condition>.parallel |
Supported | Yes | Notes | The grouping of multiple steps within a Bitbucket pipeline to be run concurrently. By default, Buildkite executes steps in parallel, unless implicit or explicit dependencies are set. Parallel Bitbucket pipeline steps are transitioned into a group step within the generated Buildkite pipeline without explicit dependencies. |
Key |
pipelines.<start-condition>.parallel.fail-fast |
Supported | No | Notes | Whether a Bitbucket pipeline allows this parallel step to fail entirely if it fails (set as true ), or allows failures (set as false ). Consider using a combination of soft_fail and/or cancel_on_build_failing in the corresponding Buildkite Pipelines command steps' attributes for a similar approach. |
Step
Bitbucket Pipelines' step
property options are used to define build execution units.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.<start-condition>.step.after-script
|
Supported |
No |
Notes |
The actions that a Bitbucket pipeline will undertake after the commands in the |
Key |
pipelines.<start-condition>.step.artifacts
|
Supported |
Partially |
Notes |
Build artifacts that will be required for steps later in the Bitbucket pipeline (by default, not obtained unless an explicit |
Key |
pipelines.<start-condition>.step.caches
|
Supported |
Yes |
Notes |
Step-level dependencies downloaded from external sources (for example, Docker, Maven, PyPi) which can be reused in later Bitbucket pipeline steps. Caches that are set at step level (or through the top-level |
Key |
pipelines.<start-condition>.step.condition
|
Supported |
Partially |
Notes |
The configuration for preventing a Bitbucket pipeline step from running unless the specific conditional is met. Translated to an inline conditional ( |
Key |
pipelines.<start-condition>.step.condition.changeset.includePaths
|
Supported |
Partially |
Notes |
The specific file (or files) that need to be detected as changed for the |
Key |
pipelines.<start-condition>.step.clone
|
Supported |
Partially |
Notes |
Clone options for a specific step of a Bitbucket pipeline. The majority of these options should be set directly on a Buildkite Agent via configuration of properties such as the clone flags ( |
Key |
pipelines.<start-condition>.step.deployment
|
Supported |
No |
Notes |
The environment set for the Bitbucket Deployments dashboard that has no translatable equivalent within Buildkite Pipelines. |
Key |
pipelines.<start-condition>.step.docker
|
Supported |
No |
Notes |
The availability of Docker in a specific Bitbucket pipeline step. This will depend on the agent configuration that the corresponding Buildkite command step is being targeted to run the job. Consider tagging agents with |
Key |
pipelines.<start-condition>.step.fail-fast
|
Supported |
No |
Notes |
Whether a specific step of a Bitbucket pipeline allows a parallel step to fail entirely if it fails (set as |
Key |
pipelines.<start-condition>.step.image
|
Supported |
Yes |
Notes |
The container image that is to be applied to a specific step within a Bitbucket pipeline. Images set at this level will be applied irrespective of the pipeline-level |
Key |
pipelines.<start-condition>.step.max-time
|
Supported |
Yes |
Notes |
The maximum allowable time that a step within a Bitbucket pipeline is able to run for. Translates to the corresponding Buildkite Pipelines command step |
Key |
pipelines.<start-condition>.step.name
|
Supported |
Yes |
Notes |
The name of a specific step within a Bitbucket pipeline. Translates to a Buildkite command step's |
Key |
pipelines.<start-condition>.step.oidc
|
Supported |
Yes |
Notes |
Open ID Connect configuration that will be applied for this Bitbucket pipeline step. The generated command step in the corresponding Buildkite pipeline will request an OIDC token and export it into the job environment as |
Key |
pipelines.<start-condition>.step.runs-on
|
Supported |
Yes |
Notes |
Allocating the Bitbucket pipeline to run on a self-hosted runner with the specific label. All |
Key |
pipelines.<start-condition>.step.services
|
Supported |
Partially |
Notes |
The name of one or more services defined at |
Key |
pipelines.<start-condition>.step.script
|
Supported |
Yes |
Notes |
The individual commands that make up a specific step. Each is translated into a singular command within the |
Key |
pipelines.<start-condition>.step.script.pipe
|
Supported |
No |
Notes |
Reusable modules to make configuration in Bitbucket pipelines easier and modular. Consider exploring the suite of available Buildkite Plugins for corresponding functionality that is required. |
Key |
pipelines.<start-condition>.step.size
|
Supported |
Yes |
Notes |
Allocation of sizing options for the given memory for a specific step within a Bitbucket pipeline. The |
Key |
pipelines.<start-condition>.step.trigger
|
Supported |
Yes |
Notes |
The configuration setting for running of a Bitbucket pipeline step manually or automatically (the default setting). For |
Stage
Bitbucket Pipelines' stage
options allow the grouping of pipeline steps with shared properties.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.<start-condition>.stage
|
Supported |
Yes |
Notes |
The logical grouping of one or more Bitbucket pipeline steps. Bitbucket pipeline stages are translated into the corresponding Buildkite pipeline as a group step. |
Key |
pipelines.<start-condition>.stage.condition.changeset.includePaths
|
Supported |
Partially |
Notes |
The specific file (or files) that need to be detected as changed for the |
Key |
pipelines.<start-condition>.stage.name
|
Supported |
Yes |
Notes |
The name of the Bitbucket pipeline stage. Transitioned to the |
Key |
pipelines.<start-condition>.stage.steps
|
Supported |
Yes |
Notes |
Individual step configuration for a Bitbucket pipeline stage. See the configuration options in this section ( |
Key |
pipelines.<start-condition>.stage.trigger
|
Supported |
Yes |
Notes |
The configuration setting for running of a Bitbucket pipeline stage manually or automatically (the default setting). For |
Variables
Bitbucket Pipelines' Custom (manual) pipeline variables allow defined variables to be set or updated when a custom pipeline is run.
Key | Supported | Notes | |||
---|---|---|---|---|---|
Key |
pipelines.<start-condition>.variables
|
Supported |
Partially |
Notes |
Custom variables that are passed to Bitbucket pipeline steps. Each variable defined in a Bitbucket pipeline step is translated to a Buildkite input step with/without defaults and allowed values specified below. |
Key |
pipelines.<start-condition>.variables.name
|
Supported |
Yes |
Notes |
The variables' name: translated to the |
Key |
pipelines.<start-condition>.variables.default
|
Supported |
Yes |
Notes |
The default variable value if no value is set. Set as the |
Key |
pipelines.<start-condition>.variables.description
|
Supported |
Yes |
Notes |
The description of the variable. Translated to the |
Key |
pipelines.<start-condition>.variables.allowed-values
|
Supported |
Yes |
Notes |
The variable's allowed values: each option is translated to a singular |