# Bitbucket Pipelines Advanced Configuration Options | Bitbucket Blitz | Atlassian

Source: https://www.youtube.com/watch?v=rljmPOzGklc
Recap page: https://rapidrecap.app/video/rljmPOzGklc
Generated: 2025-11-18T21:05:05.705+00:00

---
## Quick Overview

Bitbucket Pipelines advanced configuration in this video focuses on four key areas: Step resource allocation using the size parameter (e.g., 4x or 2x) to optimize compute resources and cost, Variable sharing between pipeline steps using output-variables, Conditional execution via the condition parameter to control step execution based on variable values, and Step failure strategies allowing options like retry or ignore failures for specific steps.

**Key Points:**
- Step resource allocation allows users to specify a size parameter (e.g., 4x, 2x, or 1x default) for steps to minimize cost and maximize performance by allocating the correct compute amount.
- Variable sharing between pipeline steps is achieved using the output-variables block in one step to define a variable and then accessing it in subsequent steps via the BITBUCKET_STEP_OUTPUT_VARIABLE_NAME environment variable.
- Conditional execution enables steps to run only when certain criteria are met, demonstrated by checking if an output variable (VAR_1) equals 5 to execute a step, or equals 3 to skip another.
- Step failure strategies allow granular control over what happens when a step fails, including setting the strategy to 'fail' (default), 'retry' (up to five times for flaky tests), or 'ignore' (allowing the pipeline to continue).
- The example pipeline structure includes steps for building, creating variables, conditional execution based on the created variable, running good tests (which pass), running bad tests (which fail but are ignored), and running flaky tests (which are retried until they pass).

![Screenshot at 00:21: Highlighting the four main advanced pipeline configuration topics being covered: Step resource allocation, Variable Sharing, Conditional Execution, and Step failure strategies.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-00-21.png)

**Context:** This Bitbucket Blitz video provides a deep dive into advanced configuration options for Bitbucket Pipelines, moving beyond basic definitions to cover features that give developers more control over pipeline execution, resource usage, and fault tolerance. The presenter walks through a sample bitbucket-pipelines.yml file within the Bitbucket interface to demonstrate how to implement resource sizing, cross-step variable passing, runtime conditional logic, and specific failure handling mechanisms.

## Detailed Analysis

The video details four advanced Bitbucket Pipeline configuration features. First, Step resource allocation uses the 'size' parameter (e.g., 4x, 2x) to define compute resources per step, defaulting to 1x if omitted, which helps manage costs. Second, Variable Sharing allows state to be passed between steps; a variable is set using 'output-variables' in an earlier step (e.g., VAR_1 = 5) and then consumed later using an environment variable referencing that output. Third, Conditional Execution uses the 'condition' parameter, evaluating shell expressions (like $VAR_1 == 5) at runtime to determine if a step should execute, allowing for branching logic. Fourth, Step failure strategies offer control over how failures are handled: the default is 'fail', but users can set 'retry' (up to 5 times) for flaky tests or 'ignore' to allow the pipeline to continue despite a step failure. The demonstration shows a pipeline executing these concepts, where a step conditional on VAR_1=3 is skipped, a step conditional on VAR_1=5 runs, flaky tests are retried until they pass, and bad tests fail but are ignored, allowing the pipeline to succeed overall.

### Advanced Pipeline Options Overview

- Step resource allocation
- Variable Sharing
- Conditional Execution
- Step failure strategies

### Step Resource Allocation

- Specify 'size' (e.g., 4x, 2x) per step
- Default size is 1x
- Optimizes cost and performance

### Variable Sharing Demonstration

- Set variable via 'output-variables' (e.g., VAR_1 = 5)
- Access variable in later steps using BITBUCKET_STEP_OUTPUT_VARIABLE_NAME
- Enables passing state between steps

### Conditional Execution Logic

- Use 'condition' block checking shell expressions (e.g., $VAR_1 == 5)
- Step runs only if condition evaluates true
- Demonstrated skipping a step when VAR_1 was 3

### Failure Handling Strategies

- Set 'strategy' on a step to 'fail' (default), 'retry' (up to 5 times), or 'ignore'
- 'retry' used for flaky tests that eventually pass
- 'ignore' used for bad tests that are expected to fail

![Screenshot at 00:03: Title card for the Bitbucket Blitz video focusing on advanced pipeline configuration features.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-00-03.png)
![Screenshot at 00:21: Slide summarizing the four core advanced configuration options covered in the tutorial.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-00-21.png)
![Screenshot at 01:32: Display of the bitbucket-pipelines.yml file showing the structure including multiple defined steps.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-01-32.png)
![Screenshot at 01:39: Zoomed view on the first step \('build'\) demonstrating the 'size: 4x' parameter for resource allocation.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-01-39.png)
![Screenshot at 02:09: Code snippet showing how an output variable \(VAR\_1\) is created and set to a value of 5.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-02-09.png)
![Screenshot at 02:28: Code snippet demonstrating conditional execution where a step runs only if the variable 'VAR\_1' equals 5.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-02-28.png)
![Screenshot at 03:02: Code snippet showing the 'good\_tests' step configured with 'on-failure: fail' strategy.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-03-02.png)
![Screenshot at 04:17: Code snippet showing the 'bad\_tests' step configured with 'on-failure: ignore' strategy.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-04-17.png)
![Screenshot at 04:27: Pipeline execution view showing the 'flaky\_tests' step ran twice \(retried\) before ultimately passing.](https://ss.rapidrecap.app/screens/rljmPOzGklc/00-04-27.png)
