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

Different bitbucket-pipelines.yml files on different branches

Salman Azmat
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 16, 2021

Hi,

If we have a bitbucket-pipelines.yml file on main branch and some one modifies this file and pushes it to the develop branch, which file would then be executed actually ?

Basically, if we have different conflicting versions of pipelines file on different branches, which one gets executed ?

1 answer

1 vote
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2021

Hi @Salman Azmat

Welcome to the community.

The YAML (bitbucket-pipelines.yml) configuration for Pipelines is based on branches and it will depend on your YAML triggers.
Initially, once you enabled Pipelines, a YAML file will be added to your main branch.
Once you created a new branch (e.g. develop) from the main branch and pushed a commit to the develop branch, Pipelines will run your YAML file from the develop branch.

Now, Pipelines triggers will vary depending on your YAML trigger configuration.

You can check out this documentation to know more about different ways to trigger a Pipelines build.

In conclusion, if you have different versions of your code for different branches, you will need to maintain your YAML file per branch.

Feel free to let me know if you have further questions that I can help with.

Regards,
Mark C

Steven Hayhurst April 10, 2024

Appreciate I'm resurrecting a very old thread here but I have this exact same issue.  Is there a way we can have one single yaml file in a repo which every branch references?  Currently when we need to make a change to a step, that change much be done in a branch and then every other branch must merge it in, in order to run the latest version of the pipeline.

Ideally I just want one bitbucket-pipelines.yml file which every branch can see and run, without running their own local copy.

(Note this is just one single repo in one workspace)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events