Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,580
Community Members
 
Community Events
165
Community Groups

Multiple merges trigger the same pipeline

So I have a project with multiple repositories. Each time I make a merge in one of those repos a bitbucket pipeline is triggered. This pipeline builds a docker image and then triggers a central pipeline in a separate repo. This central pipeline deploys my application to a server. Because of the multiple repos sometimes I make multiple merges, resulting in multiple pipelines beeing triggered in the central repo. Bitbucket in this case pauses all the pipelines and runs only the first one. Problem is I have to rerun the rest of the pipelines. Can I do that automatically?

 If I can't can I check if a pipeline is already running before triggering another one?

1 answer

0 votes

Hi Spyros and welcome to the community.

I'm afraid that it is not possible to automatically resume paused deployments at the moment.

We have a feature request about this in our issue tracker:

Since you're interested in this feature, I would suggest adding your vote to that feature request (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

 

It is possible to check if pipelines builds are running in a certain repo with our API, with a call like the following:

https://api.bitbucket.org/2.0/repositories/WORKSPACE-ID/REPO/pipelines/?sort=-created_on&status=PENDING&status=BUILDING&status=IN_PROGRESS

This endpoint is documented in the link below and I am using filters for the statuses:


Another workaround would be to create a script where you get all paused pipelines in the repo with a call like the following:

https://api.bitbucket.org/2.0/repositories/WORKSPACE-ID/REPO/pipelines/?sort=-created_on&status=PAUSED&status=HALTED

The output will show you the UUID for each paused pipeline.

You can then use an API call like the following to get the UUID of the step of each pipeline:

https://api.bitbucket.org/2.0/repositories/WORKSPACE-ID/REPO/pipelines/{PIPELINE-UUID}/steps/

And then use the following internal API endpoint to start a paused step with method POST:

https://api.bitbucket.org/internal/repositories/WORKSPACE-ID/REPO/pipelines/{PIPELINE-UUID}/steps/{STEP-UUID}/start_step

Please note that this last endpoint is an internal one and as such, it is subject to change. So, even if you decide to use it, for now, I would suggest watching the feature request I shared for updates in an official solution for this.

Kind regards,
Theodora

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,262 views 2 9
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