簡體   English   中英

Azure DevOps Pipeline 階段篩選器問題

[英]Azure DevOps Pipeline stage filter issue

語境:

我有兩條管道。 我們稱它們為triggertrigger-two

Trigger管道有多個階段,稱為TroubleshootingTroubleshooting2Troubleshooting3

我的目標是在trigger管道的TroubleshootingTroubleshooting2 2階段完成時觸發trigger-two管道。

問題:

我已遵循 Microsoft 文檔( https://docs.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops ),但無論我如何實現它, trigger-two -只有當trigger流水線完全完成時才會觸發trigger-two流水線。 由於未知原因,未考慮級過濾器。

trigger-two管道的代碼:

trigger: none

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

我試圖重現該問題,但它在我的管道中有效。 請試試我的 my yaml:

管道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" 

管道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

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM