1

I have 2 yml written both in different projects.

  1. FirstPipeline.yml
# azure-pipelines.yml
name: FirstPipeline

trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- script: echo This pipeline runs first !
  1. SecondPipeline.yml
 # azure-pipelines-trigger.yml
name: SecondPipeline 

trigger: none

# this pipeline will be triggered by another pipeline 
resources:
  pipelines:
  - pipeline: FirstPipeline   # Name of the pipeline resource
    source: FirstPipeline # Name of the pipeline referenced by the pipeline resource
    project: X Y Z # Required only if the source pipeline is in another project
    trigger: true # enable the trigger
pool:
  vmImage: ubuntu-latest

steps:
  - script: echo This pipeline was set to be triggered after first pipeline completes.

But the first pipeline is not triggered when i am running second pipeline.

rwpk9
  • 304
  • 1
  • 15
Shriya Soni
  • 81
  • 1
  • 9

1 Answers1

0

Updated the second pipeline with the below code :

azure-pipelines-trigger.yml

name: SecondPipeline

trigger: none

this pipeline will be triggered by another pipeline

resources: pipelines:

  • pipeline: 'FirstPipeline' # Name of the pipeline resource source: 'FirstPipeline' # Name of the pipeline referenced by the pipeline resource project: 'X Y Z' # Required only if the source pipeline is in another project trigger: true # enable the trigger pool: vmImage: ubuntu-latest

steps:

  • script: echo This pipeline was set to be triggered after first pipeline completes.
Shriya Soni
  • 81
  • 1
  • 9