azure-pipelines - Azure 管道,最后阶段被跳过,我不明白为什么!是否有审批限制或时间限制?
问题描述
我正在研究在 Windows 自托管代理上运行的管道。我在 Stage1 中使用一个脚本来初始化一个变量,我在 Stage2 和 Stage3 的条件中使用该变量。
如果 variable 为 true,则运行 Stage2,此阶段作为具有批准的环境。如果变量为假,则运行 Stage3 阶段。
在任何情况下,都会运行 Stage4。这现在效果很好,但如果运行 Stage2,Stage5 总是会被跳过!
我不明白为什么 Stage5 的唯一依赖项是 Stage4 !
stages:
- stage: Build
jobs:
- job: CompareFiles
dependsOn: Build_Project
steps:
- checkout: none
- task: PowerShell@2
name: compareFiles
inputs:
targetType: filePath
filePath: '***\compareFileContent.ps1'
- stage: ContinueWithApproval
dependsOn: Build
condition: eq( dependencies.Build.outputs['CompareFiles.compareFiles.filesAreEqual'], 'true' )
jobs:
- deployment: Continue
environment: 'EnvironmentWithApproval'
strategy:
runOnce:
deploy:
steps:
- task: CmdLine@2
inputs:
script: '***'
- stage: ContinueWithoutApproval
dependsOn: Build
condition: eq( dependencies.Build.outputs['CompareFiles.compareFiles.filesAreEqual'], 'false' )
jobs:
- deployment: Continue
environment: 'EnvironmentWithoutApproval'
strategy:
runOnce:
deploy:
steps:
- task: CmdLine@2
inputs:
script: '***'
- stage: DeployStaging
dependsOn:
- ContinueWithApproval
- ContinueWithoutApproval
condition: or(eq( dependencies.ContinueWithApproval.result, 'Succeeded' ), eq( dependencies.ContinueWithoutApproval.result, 'Succeeded' ))
jobs:
- deployment: Deploy_To_Staging
environment: 'Name ST'
strategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
inputs:
targetType: filePath
filePath: '***.ps1'
- stage: DeployPreProd
dependsOn:
- DeployStaging
jobs:
- deployment: Deploy_To_Preprod
environment: 'Name PP'
strategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
inputs:
targetType: filePath
filePath: '***.ps1'
如果变量为假,则运行 Stage3,然后运行 Stage4 和 Stage5 !!!
哦!Stage5的环境也有审批,会不会是这个问题?批准数量的限制 ?
谢谢和问候,克劳德
解决方案
Approvals are on environment so this should not be an issue.
Try removing
dependsOn:
- DeployStaging
From your 5th stage. The default behavior is to depend on the previous stage. I am wondering since dependsOn is being provided w/o a condition it is not skipping since the condition has not been provided.
Alternatively could add
succeeded()
推荐阅读
- python - Catkin 工具给出:"{!r}".format(fileobj)) from None 语法错误
- python - 当使用变量引用时间时,冻结时间测试用例失败
- python - 安装“pandas-profiling”时出错
- python - SPOJ for python 中的输入数据是什么类型的?以及如何在 Jupyter 笔记本中实现它?
- azure-data-factory-2 - 在后续活动中使用 Lookup 活动结果
- c# - 在 HttpClient C# 中发送带有文件的嵌套 JSON
- java - Intellij 不显示“已分配但未使用的私有字段”警告
- javascript - Jquery / JavaScript 从一个 td 的表中获取值,该表位于一个带有 id 的 div 中
- anaconda - 无法安装任何包含 tqdm 的软件包
- javascript - 无法在下拉列表 jquery 中显示 json 数据