Get started with Bitbucket Cloud
New to Bitbucket Cloud? Check out our get started guides for new users.
The options section of the bitbucket-pipelines.yml can set several global options for all of the repository’s pipelines, such as the maximum run time for steps and the resources allocated to a Pipelines Docker container. Other options can be set globally but have dedicated sections in the bitbucket-pipelines.yml, such as Git clone options, Docker image options, and Cache and Service container options.
The following global options are configured with the options property:
Contains global settings that apply to all your pipelines.
Property — options
Required — No
Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)
Allowed parent properties — The YAML root (options can only be a top-level property)
Allowed child properties — Requires one or more of the max-time, docker, size, and runtime properties.
1
2
3
4
5
6
7
8
9
10
11
options:
max-time: 30
docker: true
size: 2x
pipelines:
default:
- step:
name: Hello world example
script:
- echo "Hello, World!"
The global docker option adds a Docker service to all steps in the pipeline. This Docker service can be used to run Docker commands within any pipeline step. For information on using Docker in a Bitbucket Pipeline see Run Docker commands in Bitbucket Pipelines.
Property — docker
Required — No
Data type — Boolean
Allowed values — true or false
Default value — false
Allowed parent properties — options
1
2
3
4
5
6
7
8
9
10
options:
docker: true
pipelines:
default:
- step:
name: Hello world example
script:
- docker version
- docker run hello-world
1
2
3
4
5
6
7
8
pipelines:
default:
- step:
script:
- docker version
- docker run hello-world
services:
- docker
The max-time option sets the maximum length of time a step can run before timing out (in minutes). The max-time option can be set using both the global options property and on individual pipeline steps. The default maximum time for pipeline steps is 120 minutes.
Property — max-time
Required — No
Data type — Integer
Allowed values — A positive integer between 1 and 720
Default value — 120
Allowed parent properties — options and step
1
2
3
4
5
6
7
8
9
options:
max-time: 30
pipelines:
default:
- step:
name: Sleeping step
script:
- sleep 120m # This step will timeout after 30 minutes
1
2
3
4
5
6
7
8
9
10
11
12
13
options:
max-time: 60
pipelines:
default:
- step:
name: Sleeping step
script:
- sleep 120m # This step will timeout after 60 minutes
- step:
name: quick step
max-time: 5
script:
- sleep 120m # This step will timeout after 5 minutes
The size option allocates additional resources to a step or a whole pipeline, when running on Bitbucket Cloud infrastructure or Linux Docker self-hosted runners.
This option has no effect on shell-based runners, such as Windows PowerShell, macOS shell, and Linux shell runners, which use all available resources on on the host machine.
By default, a step running on Bitbucket Cloud infrastructure or a Linux Docker self-hosted runner has access to 4GB of memory, 4 CPUs (which might be shared with other tasks), and 64 GB of disk space per step for mounting volumes.
By specifying a size of 2x, your step or pipeline will have double the memory available. Note that the memory allocated is shared by both the script in the step and any services on the step.
Choosing a size options above 4x also grants additional CPU resources and disk space. A stepassigned a size of 4x or greater is guaranteed dedicated access to the relevant number of CPUs, and more disk space for mounting volumes. .
4x steps use four times the number of build minutes of 1x steps, 2x steps use twice the number of build minutes of 1x steps, and so on.
Size | CPU | Memory | Volume size |
---|---|---|---|
1x | 4 (shared) | 4 | 64GB |
2x | 4 (shared) | 8 | 64GB |
4x | 8 (dedicated) | 16 | 256GB |
8x | 16 (dedicated) | 32 | 256GB |
Property — size
Required — No
Data type — String
Allowed values — Either:
1x, 2x, 4x, or 8x for pipeline steps run on Bitbucket Cloud.
1x, 2x, 4x, or 8x for pipeline steps run on a self-hosted pipeline runner.
4x and 8x pipelines size options are only available for builds running under a paid Bitbucket Cloud plan (Standard or Premium).
Default value — 1x
Allowed parent properties — options and step
1
2
3
4
5
6
7
8
options:
size: 2x
pipelines:
default:
- step:
script:
- echo "2x memory is probably not needed for an echo command"
1
2
3
4
5
6
pipelines:
default:
- step:
size: 2x
script:
- echo "This step gets double the memory!"
The runtime configuration to be applied to the step.
Property — runtime
Required — No
Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)
Allowed parent properties — options and step
Allowed child properties — cloud (required)
1
2
3
4
5
6
7
8
9
10
options:
runtime:
cloud:
atlassian-ip-ranges: true
pipelines:
default:
- step:
size: 4x
script:
- echo "I use atlassian-ip-ranges"
1
2
3
4
5
6
7
8
9
pipelines:
default:
- step:
size: 4x
runtime:
cloud:
atlassian-ip-ranges: true
script:
- echo "I use atlassian-ip-ranges"
The runtime configuration to be applied to cloud steps.
Property — cloud
Required — No
Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)
Allowed parent properties — runtime
Allowed child properties — atlassian-ip-ranges (required)
This option indicates whether to use the default aws-ip-ranges or the atlassian-ip-ranges when executing your step for ingress/egress traffic.
Property — atlassian-ip-ranges
Required — Yes
Data type — Boolean
Allowed values — true or false
Default value — false
Allowed parent properties — cloud
Property — export
Required — No
Data type — Boolean
Allowed values — true or false
Default value — false
Allowed parent properties — The YAML root (export can only be a top-level property)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export: true
definitions:
caches:
services:
pipelines:
export-pipeline:
- step:
script:
- echo hello
pipelines
default:
- step:
script:
- echo hello
Was this helpful?