Let's say I have 2 separate repo's: RepoFrontEnd and RepoBackEnd. When RepoFrontEnd changes (and gets built) then another BackEndRepo needs to be rebuilt. How can I set up such a trigger?
3
votes
Does RepoFrontEnd build update the code in RepoBackEnd repository? What's the detail workflow?
– starian chen-MSFT
Here's what I'm trying to achieve - stackoverflow.com/questions/43283797/…. So, now I have to figure out how to trigger a build of RepoBackEnd (Core-P in the mentioned question) when RepoFrontEnd is built. So, this is a chained 2 repo's build process.
– alvipeo
2 Answers
2
votes
0
votes
You can use Web Hooks and use Code pushed event to trigger sending information to a URL (such as a website you developed), after receive the information you can send queue a build by REST API. Detail steps as:
- Develop a website with the functions of receiving information and queuing a build for BackEndRepo after receiving information.
- Create a web hook for the project contains RepoFrontEnd repo. In Service Hooks tab (https://account.visualstudio.com/project/_apps/hub/ms.vss-servicehooks-web.manageServiceHooks-project) -> Create subscription -> Web Hooks -> Next -> select Code pushed for Tigger on this type of event -> select RepoFrontEnd for repository -> Next -> set the URL as the website receiving information URL -> Test ( check if it works good) -> Finish.
- Enable CI build for RepoFrontEnd build definition.
Now any changes are pushed to RepoFrontEnd, builds for RepoFrontEnd and BackEndRepo will be triggered.