上下文:
我有两条管道。我们叫他们trigger和trigger-two。
Trigger管道有多个阶段,称为Troubleshooting、Troubleshooting2和Troubleshooting3。
我的目标是在trigger-two管道的Troubleshooting和Troubleshooting2阶段完成时触发trigger管道。
问题:
我已经跟踪了Microsoft ( https://learn.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops ),但是无论我如何实现它,只有在trigger-two管道完全完成时才会触发trigger-two管道。由于未知的原因,没有考虑到阶段滤波器。
trigger-two管道的代码:
trigger: none
resources:
pipelines:
- pipeline: triggertest
source: triggertest
project: project_name
trigger:
stages:
- Troubleshooting
- Troubleshooting2
branches:
include:
- refs/heads/branchtest发布于 2022-07-22 10:42:34
我试图复制这个问题,但它在我的计划中起作用。请试试我的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 your PowerShell commands here.
Write-Host "Hello World"
#in order to add the time for this stage, install a Module
Install-Module Az -Scope CurrentUser -Force管道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.
#pool:
# vmImage: windows-latest
steps:
- task: CmdLine@2
inputs:
script: |
echo Write your commands here
echo Hello world

编辑:

https://stackoverflow.com/questions/73077572
复制相似问题