Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a build step on a specific branch only

Tags:

teamcity-9.0

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?

like image 907
dwonisch Avatar asked May 20 '15 20:05

dwonisch


People also ask

How do I create a specific branch in TeamCity?

To run builds from a specific branch or set of branches automatically, configure build triggers. You can also filter history by a branch name if you're interested in a particular branch. TeamCity assigns a branch label to the builds from the default branch too.


1 Answers

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.

like image 161
dwonisch Avatar answered Oct 19 '22 20:10

dwonisch