Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I include other yaml files into the bitbucket-pipelines.yml

Adrian Moica March 2, 2024

How I can include other yaml files into the bitbucket-pipelines.yml file defining my CI/CD pipeline similar to Gitlab CI/CD Pipeline:

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 5, 2024

Hello @Adrian Moica and thank you for reaching out to Community!

Bitbucket Pipelines has a feature called shared pipelines that can be used to achieve a similar behavior as the features you have linked from GitLab.

Shared pipelines will allow you to define a "template" for your pipelines and share the template within the same workspace. This means you can import any shared pipelines, and re-use them how many times you want, avoiding having to repeatedly create each pipeline configuration.

I would suggest going through the following articles that will provide you with more details about that feature and how it can be configured : 

At the end of the page, there's also an FAQ section with common scenarios and how the shared pipelines will behave.

If after going through those articles you have any questions, feel free to ask.

Thank you, @Adrian Moica !
Patrik S

Adrian Moica June 6, 2024

Not quite the same!

  1. We are on the Standard Plan while the Share Pipelines Configurations you suggested as GitLab equivalent is available only on the Premium Plan; so its not quite the same since GitLab offers those features even to their Free Tier.
  2. The Share Pipelines Configurations feature allows only share a pipeline definition between repositories while the GitLab CI/CD configuration from other files feature allows the inclusion of external YAML files in the CI/CD pipeline definition. These are complete different features!
  3. One of my CI/CD pipelines runs many parallel pipelines that contain repetitive script parts and I was asking for the possibility of inclusion of external files into the bitbucket-pipelines.yml file in order to split that file, currently at over 800 lines and 26KB, into smaller constituent component (present in the same repository) files.

From your answer my conclusion is that Bitbucket does not support this feature of inclusion of external files into the bitbucket-pipelines.yml file, which defines a repository's CI/CD pipeline.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2024

Hello @Adrian Moica ,

thank you for your feedback.

The explicit import/include of external YAML files is indeed not yet available.

I went ahead and created a feature request to add the functionality of importing local/remote YAML files into the Bitbucket Pipelines definition : 

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Thank you, @Adrian Moica !

Patrik S

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events