Missed Team ’24? Catch up on announcements here.

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

Trigger pipeline based on commits in another repo

Aurimas N_ April 24, 2024

Hi,

I want to use the following pattern, but can't figure a way to do it in bitbucket pipelines.

 

Repo A (bussiness app A)

Repo B (k8s manifests for business app A, also pipeline definition)

 

Workflow:

Once there is merge to main branch in Repo A, pipeline from repo B triggers.

 

This is for concern separation, people developing app A are not necessary the same who are responsible for build pipelines and infra, so there is no need to clutter their repo with pipeline definition and infra elements. I've been sucessfully using this pattern in another ecosystem, how close can I get with bitbucket pipelines?

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2024

Hi Aurimas,

One option is to use a pipeline in repo A that will run on the main branch only, and the only thing it will do is trigger a build in repo B. You can use the following pipe in the yml file of repo A, to trigger a build in repo B:

You could also use our API instead:

Another option would be to use a webhook in repo A that gets triggered on repo push events. A webhook can send a request to a server of yours every time the event you have selected in the triggers occurs. After the request is received by your server, you can check the webhook payload to see if the push was made to the main branch and then use our API to trigger the pipeline in repo B.

Please feel free to reach out if you have any questions!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events