Patrik Mihalčin
Patrik Mihalčin

Reputation: 3991

Change branch name when running custom build in Teamcity

Given I have Teamcity job with Git VCS root with default branch which can be changed with branch-name parameter:

default branch

When I e.g. set branch-name to develop in admin screen, go back to build configuration home and run custom build where I change branch-name parameter to master then I get:

popup1

popup2

Why is that? What should I change, so that I don't get this message and I can change branch when running custom build?

The reason for this is I want to build and deploy software artifacts from any feature branch

Upvotes: 3

Views: 4975

Answers (1)

Senior Pomidor
Senior Pomidor

Reputation: 1915

the Teamcity has an opportunity for monitoring the branches and runs built to custom branch.

Firstly, edit your VCS Root and add follows:

Default branch: refs/heads/master
Branch specification:+:refs/heads/*

now the TC will check changes by some interval.

enter image description here

We are sets the master as default branch. and when we run the build with default parameters, the build will start to master branch

If you are want to start build with custom branch then press Run... -> Changes -> select your custom branch from Build Branch parameter.

enter image description here

If you want to run build from API, or want to reverse the build branch parameter, just set Configuration parameters with key teamcity.build.branch and value what you want

Upvotes: 3

Related Questions