0

I have created a parent pipeline in repo1 under the branch main. I have created two child pipelines, child1 is in repo_child1 under branch main and child2 is in repo_child2 under branch new_branch.

Below is the code for the pipelines:

parent pipeline code:

    trigger: none

    pool:
     vmImage: ubuntu-latest
   
   stages:
     stage: child1
     jobs:
       job:
         steps:
           script: echo "trigger child 1 pipeline"
    
     stage: child2
     jobs:
       job:
         steps:
           script: echo "trigger child 2 pipeline"

Child1 pipeline

    trigger: none

    pool:
     vmImage: ubuntu-latest
   
    resources:
     pipelines:
       pipeline: 'someidforparent'
       source: 'parent'
       trigger: 
         stages:
          - child1

  stages:
    stage:
    jobs:
      job:
        steps:
          script: echo "you are in child1 pipeline"

child2 pipeline

    trigger: none

    pool:
     vmImage: ubuntu-latest
   
    resources:
     pipelines:
       pipeline: 'someidforparent'
       source: 'parent'
       trigger: 
         stages:
          - child2

    stages:
      stage:
      jobs:
        job:
          steps:
            script: echo "you are in child2 pipeline"

When I run the parent pipeline, the child1 pipeline is triggered after the child1 stage in parent is executed. But the child2 pipeline is never called.

Can you help me understand what could be the reason that child2 pipeline is not triggered after the execution of the stage child2 in the parent pipeline?

Thanks in advance.

Nisha
  • 25
  • 3

1 Answers1

0

Can you help me understand what could be the reason that child2 pipeline is not triggered after the execution of the stage child2 in the parent pipeline?

That because the pipeline file child2.yml not exists in the branch main.

When we set the stage filters, it will search the triggered pipeline file parent.yml, which in the main branch, then it will search the child2.yml in the same branch main. That the reason why your child2 is in repo_child2 under branch new_branch not triggered.

To resolve this issue, you could add the Build completion for the child2:

enter image description here

Leo Liu
  • 71,098
  • 10
  • 114
  • 135