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

Trigger build of dependent repos after pipeline builds

Sandip Ghosh December 18, 2016

Is there a way to establish a child dependency in the configuration of a pipeline build, so that another BB repo with dependent projects get built automatically after the BB repo with the dependent code gets built. E.g. there are two repo, one that contains the project for a static library (JAR), and another repo that contains the project for a WAR. When there is a push to the JAR repo that does not involve method signature changes, the WAR project needs to be built to pick up the changes in the JAR. 

3 answers

1 accepted

0 votes
Answer accepted
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2016

Hi @Sandip Ghosh,

There is no way of adding dependent plans at the current time. A workaround would be to make a commit back to the dependent repository as part of the original pipeline which will start a pipeline on the dependent repository. However, this is a feature that we're interested in and it would really help if you could create an issue on https://bitbucket.org/site/master/issues with the pipelines component.

Cheers,
Tom

Sandip Ghosh December 19, 2016

Thanks for the response Tom, I have created a Improvement issue for the pipelines component:

https://bitbucket.org/site/master/issues/13661/trigger-build-of-dependent-repos-after

Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2016

Hi @Sandip Ghosh,

I have just thought of another option which is to post a pipeline creation request to the Bitbucket api for the dependent build after the rest of the pipeline has finished. The documentation for this can be found here https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pipelines/#post

 

Cheers,

Tom

Gareth McCumskey September 12, 2017

I have attempted to use that specific API endpoint however I constantly get "Resource not found" errors even though the API call /api/2.0/repositories/{username}/{repo_slug} does return data.

Anyone have any idea why?

Erwin Vrolijk June 19, 2019

That error is probably caused by a missing / at the end of the path in the api call. The path in the api call MUST end in a slash.

2 votes
Cory Robinson May 28, 2019

I made a Node.js package that has a cli helper to trigger pipelines (ie: downstream).

How I use it is by putting a JSON file in the my common utils repo which contains the repo name of each project that wants to have their pipeline triggered when this project's pipeline is complete. I then call the cli helper in the last step of the common utils repo pipeline and it kicks off a pipeline build for all listed repos in the JSON file.

https://www.npmjs.com/package/bitbucket-utils

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events