Trigger Pipeline from another Pipeline in Azure DevOps

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Hi @Dave and all,

I have question on pipeline resource trigger,

I have 3 branches in the single repo in the project.
Repo name : test-repo
Branch name's :
- vishnu/branch1
- branch1.yaml
- vishnu/branch2
- branch2.yaml
- vishnu/branch3
- child.yaml

Pipelines created for all the 3 pipelines named as follows
poc_branch1 (branch1.yaml)
poc_branch2 (branch2.yaml)
poc_child (child.yaml)

child yaml contains the resource trigger like below

resources:
pipelines:
- pipeline: poc_branch1
source: poc_branch1 # name of the pipeline that produces an artifact.
trigger:
branches:
include:
- refs/heads/vishnu/branch1
- pipeline: poc_branch2
source: poc_branch2 # name of the pipeline that produces an artifact.
trigger:
branches:
include:
- refs/heads/vishnu/branch2
#

trigger: none
pr: none

stages:
- stage: Consume_Artifact
displayName: Consume Artifact From Main Pipeline

jobs:
- job: Consume
displayName: Consume
steps:
displayName: 'Extracting the Triggered Pipeline alias'
inputs:
targetType: inline
script: |
Write-output "This pipeline has been triggered by:


Ideally poc_child pipeliene should be triggered once the poc_branch1 or poc_branch2 pipelines gets completed. But its not happening.

What might be reason?

If I keep child.yaml in poc_branch1 where branch1.yaml file is exists. And point the child.yaml to poc_child pipeline, the trigger works.

Appreciate for the inputs.

ksdvishnukumar
Автор

Thank you very much! Saved me a lot of time and effort! Keep up and good luck!

feol
Автор

Thanks a lot Houssem, your example was way more concrete than the Azure documentation !

bromatofiel
Автор

Mate, thank you so much for this demo - it is so much better than the Azure doco. Once again, thx heaps.🙏

blazorax
Автор

Hi, Thanks for sharing this, but I wonder How can we trigger the second pipeline when the first pipeline has failed?

Nam-imtj
Автор

I got a error Resource pipeline input not valid

dhinagaran
Автор

Hey Houssem, if the code is in a different repository and on a different branch, how can we trigger a pipeline from another pipeline?

vimalprasath
Автор

If my first pipeline is not in main branch let say branch 1 and the second one in branch 2, will this still work because for me it’s not getting triggered in this scenario

ravinandankaushal
Автор

Hi Dave
I have a template file in repository 'A".
I am running pipeline in repository in 'B" through PR ..But when i initiated the PR all pipelines are executing.

I don't want to execute all pipelines in the same REPO, with only one pipeline when i make any changes on perticular pipeline. Please suggest

maheshk
Автор

Nice Tutorial, but getting error while validation of template "pipeline resource input must be valid" at project keyword, can you please suggest here.

ramgosavi
Автор

Thanks for the video. It assures me that I have my inter-pipeline triggering (resources) setup correctly.

However when I tried to ALSO trigger my "downstream" pipeline from a local commit on that same pipeline, then that action somehow corrupted my "upstream" pipeline in another project! Microsoft support has recently just fixed the problem in the "upstream" pipeline and it's back (was not showing the Runs, some SQL issue?)

My question that I am struggling with (that I have found ZERO documentation on) is how to have a "downstream" pipeline get triggered by multiple trigger sources: (1) "upstream" pipeline (in a different project)
OR
(2) local commit on the "downstream" pipeline.
-
I am curious if you know the answer to that or have tried testing something like this previously. Thanks for posting the video.
Cheers,

EngineeringVignettes
Автор

Im wondering. we have pipeline with different stages. I want another pipeline, my e2e tests, to be triggered after tests stage has been deployed. How to configure that ?

PDuimelaar
Автор

Thanks have read about templates but now I see, they are like task groups in DevOps server 2019 right? You just can call them. Can you pass variables too?

driverafontan
Автор

the pipeline resource is not being documented anywhere. where / when is this being defined?

haydenrandolph
Автор

how can we trigger a release pipeline from another release pipeline?

PR-hfxd
Автор

But how do you call another Pipeline in another repo? error: /....yml: File /... not found in repository

JeffZiegler
Автор

Thank you very much for the video, how I can do the same but with release pipelines?? I would like to run a release pipeline and then run another release pipeline

estebanguetoarroyo
Автор

@Houssem, I have a question. I wanted to trigger the pipeline after every stage. Currently, I have four stages(DEV, QA, UAT, PROD) in a single pipeline. But the code is working after the all stages. Please suggest me,

kirankumar
Автор

I want to trigger my second pipeline only when a certain condition is met. For example, if variable “x” in pipeline 1 is = 1 then trigger the second pipeline. Is that possible. The main idea is I don’t want to trigger pipeline 2 every time pipeline 1 runs, I only want to do it in a specific case of pipeline 1

Yaabalhassan
Автор

Is it also applicable for classical pipelines ?

sounavapal