1
1
Atlassian has officially announced a significant expansion of the capabilities within Bitbucket Pipelines, specifically targeting the needs of growing development teams that require high levels of performance and organizational scale. As part of a broader strategic focus on "team scale and performance," Bitbucket Pipelines now supports the sharing of CI/CD configurations within a single repository. This update, which is now live for users on the Bitbucket Premium plan, represents a substantial evolution of the platform’s "Pipeline as Code" philosophy, building upon earlier features that allowed for the sharing of workflow configurations between entirely separate repositories.
The primary objective of this new functionality is to allow development teams to move away from monolithic, often unmanageable configuration files. Historically, as a project grew in complexity, the bitbucket-pipelines.yml file—the central nervous system of a repository’s automation—would become increasingly bloated, making it difficult to read, debug, and maintain. By introducing local configuration sharing, Atlassian is enabling teams to modularize their pipeline definitions. Instead of housing every instruction in one central file, developers can now distribute pipeline definitions into dedicated, smaller YAML files located throughout the repository. These modular files can then be referenced and imported into the main bitbucket-pipelines.yml file as needed.
This architectural shift brings several immediate benefits to DevOps engineers and software developers. First and foremost is the improvement in repository organization. By breaking down complex CI/CD logic into functional modules—such as separating security scanning, unit testing, and deployment scripts into their own files—teams can achieve a "separation of concerns" that mirrors modern software engineering practices. This modularity also enhances reusability within the repository, allowing different branches or pipeline triggers to invoke the same standardized steps without duplicating code.
In addition to internal repository sharing, Atlassian has also refined the cross-repository sharing capabilities. Previously, teams could share pipeline workflow configurations between separate repositories, but this was generally restricted to the primary bitbucket-pipelines.yml file of the source repository. With this latest update, Bitbucket now allows the importation of pipeline configurations from any YAML file within a repository, provided it follows the correct naming conventions and export protocols.
The implementation of internal configuration sharing follows a structured, three-step process designed to integrate seamlessly with existing Bitbucket Pipelines logic. The workflow is centered on the concept of exporting definitions from a sub-file and importing them into the primary configuration.
The first step involves the creation of a dedicated YAML file within the repository. To be recognized by the Bitbucket system, these files must utilize the suffix *pipelines.yml. Atlassian suggests a standard practice of placing these files in a hidden directory, such as .bitbucket/shared-pipelines.yml, to keep the root directory clean. Within this file, the user defines the specific logic of the pipeline under a definitions: pipelines section.
For example, a shared file might contain a simple "hello world" step:
definitions:
pipelines:
shared-pipeline:
- step:
name: "hello world"
script:
- echo hello
Any pipeline defined in this manner is automatically considered "exported" for the purposes of the local repository, meaning it is ready to be called upon by the main configuration file.
The second step requires the developer to declare an "Import Source" within the main bitbucket-pipelines.yml file. This is handled under the definitions: imports block. This declaration acts as a pointer, giving the main configuration file a named reference to the external file’s path. For instance, a user would map the name shared-pipelines to the file path .bitbucket/shared-pipelines.yml.
The final step is the invocation of the imported logic. Within the standard pipelines section of the main configuration file, the user specifies an import property. This property uses a specific syntax—pipeline-name@import-source-name—to tell Bitbucket which specific pipeline logic to pull from which imported file. This can be applied to various triggers, including custom pipelines, branch-specific pipelines, or pull request pipelines. Because this system supports standard pipeline start-conditions, it maintains full compatibility with manual triggers and automated scheduled runs.
While the ability to modularize within a single repository is a major boon for file management, Atlassian has also addressed the needs of organizations that manage dozens or hundreds of repositories. To facilitate this, the update includes a "Cross-Repository Export" feature. By adding a simple export: true flag at the root level of a shared configuration file, a team can make those specific pipeline definitions available to every other repository within the same Bitbucket workspace.
This creates a powerful mechanism for platform engineering teams to enforce compliance and standardization across an entire organization. A centralized "DevOps" repository could house standardized deployment or security gate YAML files. Other project repositories can then import these shared definitions by referencing the source repository, the specific branch, and the file path.
For example, if a shared configuration is located in a repository named shared-pipelines on the main branch, an external repository can import it using the following syntax:
definitions:
imports:
shared-pipelines: shared-pipelines:main:.bitbucket/shared-pipelines.yml
Once this link is established, the external repository can use the import keyword just as it would for a local file, ensuring that CI/CD logic remains consistent across the entire software portfolio without the need for manual copy-pasting of YAML code.
Atlassian has noted a current limitation regarding the user interface that developers should be aware of during this initial rollout. While the main bitbucket-pipelines.yml file in the Bitbucket UI includes a robust editor with real-time validation against the pipelines YAML syntax, the newly supported local config sharing files do not yet feature this in-editor validation.
Developers can still edit these files via the Bitbucket web interface, but the system will not immediately flag syntax errors or indentation issues within the UI for these specific sub-files. Atlassian has confirmed that they are actively working to extend pipelines validation to these custom config sharing files in the near future to ensure a smoother developer experience and to reduce the "trial and error" often associated with CI/CD configuration.
This update is currently exclusive to the Bitbucket Premium plan, a move that aligns with Atlassian’s strategy of offering advanced governance, scaling, and performance features to enterprise-tier customers. The Premium plan is designed for organizations that require deeper control over their development workflows, and the addition of modular pipeline sharing fits squarely into this value proposition.
By allowing for more sophisticated configuration management, Bitbucket is positioning itself more competitively against other major players in the DevOps space, such as GitHub and GitLab, both of which offer various forms of configuration "includes" or "templates." The Bitbucket approach emphasizes a clean, declarative syntax that integrates directly into the existing definitions structure that Pipelines users are already familiar with.
Looking ahead, Atlassian indicates that this is merely one step in a larger journey toward providing "unprecedented level of flexibility" for CI/CD. The company’s public roadmap suggests that further enhancements to how pipelines are shared, configured, and executed are on the horizon. These future updates are expected to continue the trend of reducing technical debt in CI/CD pipelines and providing platform teams with the tools necessary to manage complex, multi-repository environments with minimal friction.
For teams looking to implement these features immediately, Atlassian has updated its official support documentation with comprehensive guides on setting up both internal and cross-repository configuration sharing. This documentation provides additional technical nuances, such as how to handle environment variables and secret management within the context of imported pipeline steps. As organizations continue to adopt microservices and distributed architectures, these modular CI/CD capabilities will likely become a cornerstone of efficient software delivery on the Bitbucket Cloud platform.