0

I can't get my yaml pipeline to trigger based off the build completion of another pipeline.

This is the code from the yaml pipeline I am trying to trigger to run, where pipelineX is the name of the pipeline build I want the run to trigger off of:

      resources:
        pipelines:
        - pipeline: trigger-pipeline
          source: pipelineX
          trigger: true 

      steps:
      - task: Bash@3
        inputs:
          targetType: 'inline'
          script: |
            echo 'pipeline runs here'

Both pipelines are part of the same project, so that should not be an issue.

chuanm
  • 3
  • 2

1 Answers1

0

I have similar setup with my project. I am triggering 'PipelineNeedsTrigger' build based on successful build of 'PipelineTriggerFrom' pipeline. Both pipelines are under the same project. I have exported my YAML and added snippet here which might help you. I have added below trigger into my 'PipelineNeedsTrigger' which will trigger once the 'PipelineTriggerFrom' has successful build on 'master' branch. This might help you link.

resources:
  pipelines:
  - pipeline: PipelineTriggerFrom
    source: PipelineTriggerFrom
    trigger:
      branches:
        include:
        - refs/heads/master
Chinmay T
  • 745
  • 1
  • 9
  • 17