Run a build step on a specific branch only

我是研究僧i 提交于 2019-12-21 12:19:15

问题


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.

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

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.

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?


回答1:


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

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




回答2:


Why not create a two build configuration for that, one checking code from master, second from branch? IMHO it should not be steps in the same build as they are not chained.



来源:https://stackoverflow.com/questions/30359564/run-a-build-step-on-a-specific-branch-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!