【问题标题】:TFS 2018: Gated checkin with build variablesTFS 2018:使用构建变量进行门控签入
【发布时间】:2018-07-29 13:51:37
【问题描述】:

在我们的 TFS2018 网站上,我为我们的开发分支和发布分支进行了构建定义。发布分支具有以下命名约定:Release_yyyy_mm_dd。

DEV Branch
|
 -- Release Folder
|   |
|   -- Release_2018_01_01 Branch
|   -- Release_2018_01_15 Branch
|   -- Release_2018_01_29 Branch *current*

我们有很多代码需要构建(MAP 文件夹)和很多不需要构建的代码(CLOAK 文件夹)。

例如:

MAP Release_2018_02_22\ServiceA  
MAP Release_2018_02_22\ServiceB  
CLOAK Release_2018_02_22\ServiceC  
CLOAK Release_2018_02_22\GigsOfDataThatDoesntNeedGetting  
*repeat this for 50 folders*

我们每次 sprint 都会发布,所以我每次都要调整发布分支文件夹。这就是我引入构建变量 $(CurrentReleaseBranch) 的原因。

例如:

$(CurrentReleaseBranch) on the variables TAB set to "Release_2018_02_22".  
MAP $(CurrentReleaseBranch)\ServiceA  
MAP $(CurrentReleaseBranch)\ServiceB  
CLOAK $(CurrentReleaseBranch)\ServiceC  
CLOAK $(CurrentReleaseBranch)\GigsOfDataThatDoesntNeedGetting  
*repeat this for 50 folders*

我在此构建定义上有一个门控签入触发器,并选中了 Use workspace mappings for filter 选项。 在此分支上签入代码时,不会显示门控签入。
当我在映射中使用硬编码路径时,门控签入对话框确实出现在 Visual Studio 中。
如何在使用变量的同时仍然进行门控签到?

【问题讨论】:

    标签: tfs visual-studio-2017 azure-pipelines gated-checkin


    【解决方案1】:

    你不能。不支持路径映射中的变量。如果您需要以这种方式支持许多不同的分支,最简单的选择是使用脚本语言(如 PowerShell)和 REST API 的组合自动化您想要执行的操作,以克隆/更新构建定义 JSON。

    【讨论】:

      猜你喜欢
      • 2011-07-24
      • 1970-01-01
      • 2018-05-31
      • 2017-02-06
      • 1970-01-01
      • 2014-12-08
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多