Get started with Bitbucket Cloud
New to Bitbucket Cloud? Check out our get started guides for new users.
Atlassian offers two primary options for CI/CD (continuous integration and continuous delivery) in Bitbucket Cloud: Bitbucket Pipelines (built-in to Bitbucket Cloud) and Bamboo Data Center.
If you’re using Bitbucket Cloud to for your code, migrating your CI/CD pipelines to Bitbucket Pipelines will improve your overall CI/CD experience. Since it’s built-in to Bitbucket Cloud, there is no integration to manage or plugins to install. You’ll be able to use Atlassian’s cloud runners to scale on demand (or connect to your own runners), easily extend your workflows using Pipes, and manage your pipelines at scale to meet your compliance needs. Learn more about the benefits of migrating to Bitbucket Pipelines.
For customers looking to migrate from Bamboo to Bitbucket Pipelines, here is a guide on how the syntax varies and guidelines on how to plan your migration.
Let’s start with some explanation around how variables are defined.
Bitbucket Pipelines categorizes variables in the following way:
Default variables: Pipelines provides a set of default variables that are available for builds and can be used in scripts. For example, $BITBUCKET_BUILD_NUMBER.
Workspace variables: Variables specified for a workspace can be accessed from all repositories that belong to the workspace.
Repository variables: Pipelines variables added at the repository level can be used by any user who has write access in the repository.
Deployment variables: You can also define variables so that they can only be used in a specific deployment environment.
It’s also worth mentioning that Bitbucket Pipelines supports OIDC (OpenID Connect) to allow accessing third-party and internal applications securely without storing credentials.
Bamboo categorizes variables based on their scope as follows:
Build-specific variables: Evaluated dynamically at build time from Bamboo properties or plugins. For example ${bamboo.planKey}.
Deployment variables: Available during project deployment.
System variables: Apply across the entire Bamboo instance, inheriting values from system or environment variables.
Global variables: Defined at the instance level with static values for every plan.
Project variables: Defined for specific projects, capable of overriding global variables.
Plan variables: Defined for specific plans, capable of overriding global and project variables, and can be manually overridden during builds.
With these fundamental differences in how variable are set, here are some examples on how to migrate a Bamboo plan to Bitbucket Pipelines.
Below are several examples and syntax comparisons for migrating from Bamboo to Bitbucket Pipelines.
Bamboo YAML spec | Pipelines |
---|---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
version: 2
plan:
project-key: PROJ
key: PLAN
name: Example Plan
stages:
- Stage 1:
jobs:
- Job 1
Job 1:
tasks:
- script:
- echo 'Hello World' | 1
2
3
4
5
6
7
image: atlassian/default-image:4
pipelines:
default:
- step:
name: Example
script:
- echo 'Hello World' |
Bamboo YAML spec | Pipelines |
---|---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
version: 2
plan:
project-key: PROJ
key: PLAN
name: Example Plan
stages:
- Stage 1:
jobs:
- Build and Test
- Lint
- Security scan
Build and Test:
tasks:
- script:
- echo "Your build and test goes here..."
Lint:
tasks:
- script:
- echo "Your linting goes here..."
Security scan:
tasks:
- script:
- echo "Your security scan goes here..." | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
image: atlassian/default-image:4
pipelines:
default:
- parallel:
- step:
name: 'Build and Test'
script:
- echo "Your build and test goes here..."
- step:
name: 'Lint'
script:
- echo "Your linting goes here..."
- step:
name: 'Security scan'
script:
- echo "Your security scan goes here..." |
The following Pipeline code shows an example of how to create a Pipeline using environment variables for secret text credentials.
Bamboo YAML spec | Pipelines |
---|---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
version: 2
plan:
project-key: PROJ
key: PLAN
name: Example Plan
stages:
- Stage 1:
jobs:
- Example Job
Example Job:
tasks:
- script:
- echo "Running ${bamboo.buildNumber} on ${bamboo.planRepository.repositoryUrl}" | 1
2
3
4
5
6
7
image: atlassian/default-image:4
pipelines:
default:
- step:
name: Example
script:
- echo "Running $BITBUCKET_BUILD_NUMBER on $BITBUCKET_GIT_HTTP_ORIGIN"
|
Bamboo YAML spec | Pipelines |
---|---|
Based on your settings, Bamboo can determine if a build is hanging or timed out. You can override these settings for individual plans in the executable configuration of each plan. Build monitoring is enabled by default. | In Pipelines, you can set a parameter to define a timeout limit for each step. 1
2
3
4
5
6
7
8
image: atlassian/default-image:4
pipelines:
default:
- step:
name: Example
script:
- echo 'Hello World'
max-time: 60 # Timeout in minutes |
Bamboo YAML spec | Pipelines |
---|---|
1
2
3
4
5
---
version: 2
#short syntax
triggers:
- cron: 0 * * * ? * | Bitbucket Pipelines scheduled builds are configured in the user interface. You can easily set up and manage your build schedules, specify the frequency, and timing of builds. |
Bamboo YAML spec | Pipelines |
---|---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
version: 2
plan:
project-key: PROJ
key: PLAN
name: Example Plan
stages:
- Lint and Test:
- Lint
- Build Artifact:
- Build Artifact
- Publish Image:
- Publish Image
Lint:
tasks:
- script:
- npm install
- npm lint
docker:
image: node:alpine
Build Artifact:
tasks:
- script:
- ${bamboo_capability_system_builder_npm} install
- ${bamboo_capability_system_builder_npm} run build
- script:
- cp -r content build/
- cp release/* build/
requirements:
- node
artifacts:
- name: release
pattern: build/**
Deploy Image:
tasks:
- artifact-download:
source-plan: PROJ-PLAN
artifacts:
- name: release | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
image: atlassian/default-image:4
pipelines:
default:
- step:
name: Lint and Test
caches:
- node
script:
- npm install
- npm lint
- npm test
- step:
name: Build Artifact
script:
- npm install
- npm run build
- cp -r content build/
- cp release/* build/
- zip -r build.zip build/
artifacts:
- build.zip
- step:
name: Deploy Image
services:
- docker
script:
- pipe: atlassian/aws-code-deploy:1.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: $S3_BUCKET
COMMAND: "upload"
APPLICATION_NAME: "my-application"
ZIP_FILE: "build.zip" |
We recommend a progressive migration approach for moving from Bamboo to Bitbucket Pipelines. This strategy allows you to gradually transition your existing repositories to Bitbucket Pipelines while still leveraging Bamboo where necessary, helping to ensure a smooth and efficient transition.
You can start by migrating less critical repositories or parts of your build processes to Bitbucket Pipelines, testing and refine your configurations along the way. During this transitional period, you can configure Bitbucket Pipelines to trigger Bamboo jobs using the bamboo-trigger-build pipe. This hybrid approach enables you to gradually familiarize your team with Bitbucket Pipelines and address any migration challenges without disrupting your ongoing development processes.
Here you have some examples on how to trigger a basic Bamboo job from Pipelines:
1
2
3
4
5
6
7
script:
- pipe: atlassian/bamboo-trigger-build:0.6.0
variables:
BAMBOO_ENDPOINT: 'http://your-bamboo.net:8085'
PROJECT_KEYWORD: 'TEST'
PLAN_KEYWORD: 'TEST'
TOKEN: '<your access token>'
Trigger a Bamboo job build and wait for the build to complete:
Make sure to set a sufficient WAIT time for your workflows.
1
2
3
4
5
6
7
8
9
script:
- pipe: atlassian/bamboo-trigger-build:0.6.0
variables:
BAMBOO_ENDPOINT: 'http://your-bamboo.net:8085'
PROJECT_KEYWORD: 'TEST'
PLAN_KEYWORD: 'TEST'
TOKEN: '<your access token>'
WAIT: 'true'
WAIT_INTERVAL: '15'
Was this helpful?