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

How to trigger a pipeline in a repo with a webbook that is inside another one?

Demba Diack July 8, 2022

I have a main repository witch have multiple submodules, and one pipeline in it.

the goal is to run the pipeline in the main repository when ever there is a change in the submodules, with the submodules name maybe as a parameter.

is there a way to do that in bitbucket?

thank you!

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2022

Hi @Demba Diack and welcome to the community!

  1. What kind of pipeline do you have in the main repository? Is it the default one? Is it defined to run on a certain branch or a tag? Or is it a custom pipeline?

  2. When you make changes in a submodule, do you push these changes to the main repo as well so that it points to the newest commit of the submodule?

  3. Do you use the source code of the submodules in the pipelines builds than run in the main repo?


In case you have a pipeline running e.g. on master branch of the main repo, if you push the submodule update to master branch of the main repo, then the pipeline will get triggered.

It is also possible to configure a webhook in a submodule repo that runs on every push to the submodule, sends a request to your server, and you can then trigger the pipeline in the main repo with an API call:

Another thing you could do is have another pipeline in each submodule (e.g. the default pipeline that runs on every push to a submodule) and have that pipeline trigger the pipeline of the main repo using the following pipe:

Please keep in mind though that if you don't push the submodule update to the main repo, the main repo will point to an earlier commit of the submodule.

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