仅在特定分支上运行构建步骤 [英] Run a build step on a specific branch only

查看:88
本文介绍了仅在特定分支上运行构建步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个构建步骤"Build"和"Deploy"的构建配置. 此构建配置使用Git VCS,并配置为运行所有分支.

I have a build configuration containing two build steps "Build" and "Deploy". This build configuration is using a Git VCS and is configured to run all branches.

让我们假设我目前有两个分支"master"和"Feature in Development".

Let's assume that I currently have two branches "master" and "Feature in Development".

我想将部署"步骤分为两步. 部署生产"和部署Beta". 仅当更改了master分支且当前正在构建时,才应执行部署生产"步骤.

I want to divide the "Deploy" step into two. "Deploy Production" and "Deploy Beta". The "Deploy Production" step should only be executed when the master branch was changed and is currently building.

是否有内置的方法可以执行此操作,或者我必须在脚本中手动检查%teamcity.build.branch.is_default%变量?

Is there a built in possibility to do that or do I have to check the %teamcity.build.branch.is_default% variable manually within the script?

推荐答案

JetBrains似乎在TeamCity v9.1中添加了此功能.

It seems that JetBrains added this feature in TeamCity v9.1.

对于v9.0,我使用了Powershell脚本并检查了'%teamcity.build.branch.is_default%' -eq 'true' build属性.

For v9.0 I used a Powershell script and checked '%teamcity.build.branch.is_default%' -eq 'true' build property.

这篇关于仅在特定分支上运行构建步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆