I want to trigger a Test pipeline from a stage of Main pipeline, both the pipelines are present in different projects within the same organization. I am able to trigger the pipeline using the resource option but the problem is it triggers the Test pipeline when Main pipeline finishes successfully but I want to trigger the Test pipeline in between run of Main pipeline using an stage. Is it possible to achieve this using any feature of Azure Devops?
For now I am adding this resource in Test pipeline yaml to trigger after Main pipeline.
resources:
pipelines:
- pipeline: Test-Repo
source: Test # Test pipeline from different project
project: private
trigger: true # enable the trigger
2
Answers
As a workaround, you can trigger the needed build through REST API. Check this: Powershell to trigger a build in Azure DevOps
A good approach is using Extension "Trigger Build Task": https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks&targetId=ca4e4e67-3099-4c62-9ea9-bef80e0cc70a&utm_source=vstsproduct&utm_medium=ExtHubManageList
My main Pipeline is in Project A with two stages:
Run Main Pipeline in Project A:
Test Pipeline in Project B is triggered at Main Pipeline Stage A:
Test Pipeline in Project B.