I'm working with a repository (A
) that contains a different repo as a sub-module (B
). The contents of repo B
is used by the logic in A
, and needs to be updated regularly.
I currently have an Azure build pipeline which is triggered whenever a push to A
occurs. I've also made sure that the artifact created by the build contains data from B
. This is defined in Yaml; in short:
trigger:
branches:
include:
- master # <-- Trigger a build when the branch 'master' is pushed to!
I can see in the documentation that it is possible to connect this trigger to different branches and / or paths in the same repository.
The problem is that as a sub-module, Repo B
is really a completely separate repo, which is pushed to quite separately from A
. This means that even though B
is updated when A
is pulled during the build pipeline, pushes to B
do not automatically register as pushes to A
, so the build is not triggered.
I would be great if I could do something similar to the following to make up for this...
trigger:
branches:
include:
- master
- my-other-repo-B # <-- Trigger a build when B is pushed to!
... but this does not seem to be possible, as far as I can tell.
My current best option seems to be to create a separate build for B
, and then add an extra trigger in Azure DevOps which initiates the main build whenever that has run. That should in theory work, but I would really prefer to control both triggers for the build in the same place, if possible.
Are there any other good / clean ways to achieve this?