AzureDevOpsPipeline阶段筛选问题
创始人
2024-09-29 16:30:10
0
  1. 使用变量控制阶段的跳过和执行 在 YAML 文件中定义一个变量,例如:

variables: runStageA: true runStageB: false

在 stage 中使用 condition 条件判断控制阶段的跳过和执行,例如:

stages:

  • stage: A condition: eq(variables['runStageA'], true) steps:

    • ...
  • stage: B condition: eq(variables['runStageB'], true) steps:

    • ...

这样,通过修改变量的值来控制阶段的跳过和执行。

  1. 使用 regular expression 筛选阶段 可以使用名称模板和 regular expression 筛选阶段,例如:
  • stage: A displayName: 'Build $(Build.Platform) $(Build.Configuration)' condition: | and(succeeded(), or( eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/develop') ), or( eq(stageDependencies.BuildArtifact.A.outputs['BuildPlatform'], 'win-x86-Release'), eq(stageDependencies.BuildArtifact.A.outputs['BuildPlatform'], 'linux-x64-Debug') ) ) ...

其中 eq(stageDependencies.BuildArtifact.A.outputs['BuildPlatform'], 'win-x86-Release') 中的 'BuildPlatform' 是 artifact 中输出变量的名称。

  1. 使用阶段依赖引用 可以在 YAML 文件中定义一个阶段依赖:
  • stage: Deploy dependsOn: Build

这样,在后续的阶段中可以使用 dependsOn 引用前面的阶段:

  • stage: Test dependsOn: Deploy condition: eq(dependencies.Deploy.result, 'Succeeded') ...

这样可以实现阶段的有序执行。

相关内容

热门资讯

总算清楚!wepoker正确养... 总算清楚!wepoker正确养号方法,德州透视是真的假的,新2025教程(有挂神器);亲真的是有正版...
实测交流!pokerrrr2辅... 实测交流!pokerrrr2辅助,hhpoker透视方法,细节揭秘(有挂技巧);1分钟了解详细教程(...
总算明白!hhpoker必备开... 总算明白!hhpoker必备开挂,pokernow辅助控制,玩家教程(有挂技巧)1、玩家可以在pok...
技术分享!拱趴大菠萝作弊方法,... 技术分享!拱趴大菠萝作弊方法,wepoker透视脚本免费,教你攻略(有挂软件)准备好在拱趴大菠萝作弊...
揭秘关于!hhpoker到底可... 1、揭秘关于!hhpoker到底可以作弊码,pokemmo脚本手机版,2025新版(有挂神器)(UU...
必知教程!wepoker私局代... 必知教程!wepoker私局代打,wepoker怎么买辅助,靠谱教程(有挂软件)准备好在wepoke...
总算了解!we poker游戏... 总算了解!we poker游戏下,hhpoker透视脚本下载,2025版教程(有挂技巧);人气非常高...
总算了解!wepoker破解器... 总算了解!wepoker破解器激活码,aapoker免费透视脚本,揭秘教程(有挂攻略);支持多人共享...
推荐一款!德州透视插件,wej... 推荐一款!德州透视插件,wejoker黑侠辅助器,透视教程(有挂技巧);人气非常高,ai更新快且高清...
实测教程!hhpoker辅助器... 1、实测教程!hhpoker辅助器,hh poker插件下载,必备教程(有挂辅助)2、进入游戏-大厅...