It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Questions about bitbucket-pipelines.yml that I could not find via google

So I've run into two questions that I can't seem to find the answer to after doing some googling, and I'm a bit surprised the docs don't cover them at all.

First is, in the branches portion of the pipelines file, how do I reference branches that are in folders/nested? For example the branch testing/johnQA? I tried exactly that format but the pipeline is only running default for that branch so evidently it's not parsing it correctly.

Second question is: how does it work if bitbucket-pipelines.yml is different across branches? Note that I'm talking about an instance where this file already defines seperate actions for each branch, so I'm curious how a conflict would be handled, particularly between the file checked into master and a different file checked into a branch running a pipeline. Would master always take precedence? Or would the branch first use the file in itself for the pipeline?

Thanks!

1 answer

0 votes

Hi @Liam S ,

Welcome to our community, I see you are new here =]

how do I reference branches that are in folders/nested? For example the branch testing/johnQA? 

That is not possible at the moment due to a bug affecting the background API for pipelines #15358 - REST API 2.0 to get raw content of an individual file on fails in case of slash in the branch name. 
It also blocks you to create a schedule trigger for such branch as you can see in this question: Solved: Unable to schedule bitbucket pipeline.

We are sorry about that, but until it is fixed the only workaround is to avoid branch names with special characters on it.

how does it work if bitbucket-pipelines.yml is different across branches?
(...) Would master always take precedence? Or would the branch first use the file in itself for the pipeline?

I got your point. The behavior here is that pipelines will always consider the YML file present in the branch who receives a commit or a merge (the branch to be built).

I hope that answers your questions.

Hey thanks for the update!

So in regards to the issue with slashes in the branch name, is their an ETA (even just a rough one) on a fix for that issue? Looks like it was reported and acknowledged over a year ago - so just curious if a fix will be coming soon

 

FYI for yourself/others reading this - it appears at least part of this issue has a workaround - I was able to at least get pipelines running by wrapping the branch names in the pipeline definitions part of bitbucket-pipelines.yml with single-quotes like so:

pipelines:

branches:
master:
- step: *lint

'testing/primaryQA':
- step: *build
- step: *deploy

Haven't tested whether this works in the browser for scheduling pipelines and I suspect it still won't work for the REST API like you said, as that's a seperate parser that's probably still going to be unhappy even wrapped in single quotes

 

Thanks again!

Like Daniel Santos likes this

@Liam S

Thank you for sharing your findings here. That will be useful for other users.

Regarding your question on a fix, I'm working on it internally so we can bring more attention to this case. I still don't have an ETA. Please keep your eyes on #15358 - REST API 2.0 to get raw content of an individual file on fails in case of slash in the branch name for more updates.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...

453 views 0 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you