How can I include other yaml files into the bitbucket-pipelines.yml
Asked by Adrian Moica:

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

* <https://docs.gitlab.com/ee/ci/yaml/includes.html#include-a-single-configuration-file>
* <https://docs.gitlab.com/ee/ci/yaml/includes.html#include-an-array-of-configuration-files>


Answers:
author: Patrik S
body: Hello [@Adrian Moica](/t5/user/viewprofilepage/user-id/2983205) 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 :

* [Share Pipelines Configurations](https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/)

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](/t5/user/viewprofilepage/user-id/2983205) !  
Patrik S

comments: author: Adrian Moica
body: Not quite the same!

1. We are on the Standard Plan while the [Share Pipelines Configurations](https://support.atlassian.com/bitbucket-cloud/docs/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](https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/) feature allows only share a pipeline definition between repositories while the [GitLab CI/CD configuration from other files](https://docs.gitlab.com/ee/ci/yaml/includes.html#include-a-single-configuration-file) 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.


author: Patrik S
body: Hello [@Adrian Moica](/t5/user/viewprofilepage/user-id/2983205) ,

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 :

* <https://jira.atlassian.com/browse/BCLOUD-23269>

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](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) in mind.

Thank you, [@Adrian Moica](/t5/user/viewprofilepage/user-id/2983205) !

Patrik S


Tags: bitbucket-cloud

cloud

include-yaml