Hello Bitbucket Community! Bitbucket Pipelines now passes unsecured variables to Dynamic Pipeline Providers (DPP), giving them the context needed to generate pipeline configurations dynamically. Use pipeline, repository, workspace, and system variables to customize deployments, reuse shared settings, improve traceability, and integrate with external systems.
You can now pass several types of variables to Dynamic Pipeline Providers (DPP):
Pipeline Variables: Defined in your bitbucket-pipelines.yml file under custom pipelines or provided at runtime via the UI or API. We also recently shared a blog post detailing how pipeline variables can be passed and templated here.
Repository Variables: Set at the repository level in Bitbucket settings, these allow consistent configuration across a specific repository.
Workspace Variables: Available across all repositories within a workspace, facilitating shared settings among multiple projects.
System Variables: Built-in Bitbucket variables, such as BITBUCKET_BRANCH, that provide essential context for your pipelines.
Only unsecured variables are passed to the DPP to maintain security, while sensitive or secured variables are excluded.
The variable payload is limited to a total size of 25 KB. If the limit is exceeded, variables will be truncated in the payload. The truncation order prioritizes storing pipeline variables first, followed by repository, workspace, and finally system variables. When truncation occurs, the payload includes the boolean field variables_truncated set to true.
Passing variables to Dynamic Pipeline Providers (DPP) offers significant benefits:
Flexible Deployments: Easily switch environments and toggle features without editing YAML files, allowing for adaptable and responsive pipeline configurations.
Efficiency and Reuse: Share configurations across pipelines using repository and workspace variables, reducing maintenance and simplifying updates.
Improved Compliance: Pass metadata for logging and compliance, ensuring actions are traceable and secure.
Optimized Resources and Integrations: Dynamically adjust resources and integrate with external systems using non-secret values, enhancing efficiency and functionality.
Read more information about Dynamic Pipelines here.
Happy Coding! We’d love to hear your feedback and learn how you’re using variables with Dynamic Pipeline Providers.
Edmund Munday
0 comments