【发布时间】:2020-11-11 03:31:55
【问题描述】:
其他管道完成后无法触发管道
原创
我正在尝试在 devops yaml 管道中为我们的 Angular 应用程序构建多个发布管道。我们正在使用 Nx 工作区,因此能够在工作区构建结束时触发这些管道非常重要。
这是微软提供的示例文档代码 (https://docs.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops&tabs=yaml)
# this is being defined in app-ci pipeline
resources:
pipelines:
- pipeline: securitylib # Name of the pipeline resource
source: security-lib-ci # Name of the triggering pipeline
trigger:
branches:
- releases/*
- master
这是我此时的完整管道:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger: none
resources:
pipelines:
- pipeline: WorkspaceBuild
source: OtherPipeline
project: CommonProject
trigger:
branches:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'web-framework'
downloadPath: '$(System.ArtifactsDirectory)'
- script: |
cd $(System.ArtifactsDirectory)
dir .
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
更新
好的,修复命名允许每个管道运行。但是,构建管道仍然不会触发部署管道。
Respective Pipelines (UPS1_Workspace build, wf-stg deploys)
Deployment pipeline resources tag
Deployment pipeline triggers settings
更新 2
嘿,这仍然不起作用。我从触发器 ui 面板中删除了所有 CI 设置,并确保未勾选覆盖框。这里还有一些有助于诊断的图片
【问题讨论】:
-
构建管道是否使用 PublishPipelineArtifact 任务发布任何工件?
-
是的,到了最后。我已经验证了管道发布,如果我手动运行触发的管道,它会下载它