I have a build configuration with a test VCS root that connects to git branch dev
, 3 build steps and 1 trigger. These are my build steps:
- Build tests
- Run tests
- Build & Deploy
I would like to run all of these build steps for branch dev
but only two of them (build and run tests) for branches matching feature/*
. I want this to be displayed under my build configuration. So the build configuration has a default dev
branch that runs tests and deploys, but the feature/*
additional branches only run tests.
How can I achieve this?
If I add /refs/heads/(feature/*)
to the branch specification (below default branch), this works perfectly, but it always deploys - which I don't want.
Edit 1: There seems to be a variable available named %teamcity.build.branch%
that you can use. But how to do a conditional in the deployment step to check if the branch is the dev
branch. I'm not sure.
Edit 2: There is also a variable name %vcsroot.branch%
that is the name of the default branch in the VCS root. So we still need a condition that checks if the %teamcity.build.branch%
variable equals %vcsroot.branch%
, then run the deployment step.