简体   繁体   中英

Azure DevOps Pipeline stage filter issue

Context:

I have two pipelines. Let's call them trigger and trigger-two .

Trigger pipeline has multiple stages, called Troubleshooting , Troubleshooting2 , and Troubleshooting3 .

My aim is to trigger trigger-two pipeline when the stages Troubleshooting and Troubleshooting2 from trigger pipeline are completed.

Issue:

I have followed Microsoft documentation ( https://docs.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops ), but no matter how I implement it, the trigger-two pipeline is triggered only when the trigger pipeline is fully completed. The stage filter is not taken into consideration for unknown reasons.

Code for the trigger-two pipeline:

trigger: none

resources:
  pipelines:
  - pipeline: triggertest  
    source: triggertest
    project: project_name
    trigger:
      stages:
        - Troubleshooting
        - Troubleshooting2
      branches:
        include:
          - refs/heads/branchtest

I tried to reproduce the issue, but it works in my pipeline. Please try my my yaml:

pipeline trigger

trigger:
- none

pool:
  vmImage: windows-latest

stages:
- stage: Troubleshooting1
  jobs:
  - job: Troubleshooting1
    steps:
    - task: PowerShell@2
      inputs:
        targetType: 'inline'
        script: |
          Write-Host "Hello World"
- stage: Troubleshooting2
  jobs:
  - job: Troubleshooting2
    steps:
    - task: PowerShell@2
      inputs:
        targetType: 'inline'
        script: |
          Write-Host "Hello World"
- stage: Troubleshooting3
  jobs:
  - job: Troubleshooting3
    steps:
    - task: PowerShell@2
      inputs:
        targetType: 'inline'
        script: |
          Write-Host "Hello World" 

Pipeline trigger-two

trigger: none

resources:
  pipelines:
  - pipeline: trigger-resource  
    source: trigger
    project: testproject
    trigger:
      stages:
        - Troubleshooting1
        - Troubleshooting2
      branches:
        include:
          - refs/heads/main

pool: Default # Specify a self hosted agent pool by name. Because I only have one MS-hosted agent parallel job. So I use different pool in two yaml.

steps:
- task: CmdLine@2
  inputs:
    script: |
      echo Write your commands here
      echo Hello world

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM