Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket : Include file from other repository

need some help. I just want to include a .yaml file from another repository as a template in Bitbucket. I am more on GitLab but for now I want this for Bitbucket.

.gitlab-ci.yml

include:
  - project: 'testy/repo/template'
    ref: main
    file: '/.templates/template.yml'

how can I do this in Bitbucket?

like image 702
rkevx21 Avatar asked Sep 04 '25 01:09

rkevx21


1 Answers

Unlike GitLabCI, there is no way to do that in Bitbucket Pipelines.

Such feature request has been filed multiple times but AFAIK it never recieved Atlassian's attention. Because Jira sucks I am uncapable of finding historical tickets with years of people ranting about this shortcoming but you get the idea: https://jira.atlassian.com/browse/BCLOUD-20922

You can reuse some code with pipes but the workflow is much more cumbersome than including a yaml from a shared repository and definitely can't reuse pipelines as such, only script fragments.

like image 52
N1ngu Avatar answered Sep 07 '25 19:09

N1ngu