In RoC VCS settings you can set the specification of the branch. The Branch specification allows you to run a specific branch (for example: +:feature/*
)
Then, a combo box will appear at the top of your project to select your project.
If the build branch depends on something in your code, you can perform several configurations, with dependencies, and run using the API.
Line 1
Set to <default>
where you will run the branch. API A call to the teamcity command, which will call Build 2 with the branch
parameter set to the specified value:
# RunSpecificBranch.ps1 # PowerShell: Run Build Configuration on a specific branch Param( [Parameter(Mandatory=$true)][string]$branchName, [Parameter(Mandatory=$true)][string]$BuildToRun ) Begin { $TCUrl = "http://<teamcityURL>/httpAuth/app/rest/buildQueue" Execute-HTTPPostCommand $TCUrl "<build branchName=""$branchName""><buildType id=""$buildToRun""/></build>" }
And run this script like: RunSpecificBranch.ps1 -branchName: feature/ME/AwesomeFeature -buildToRun: Project_SubProject_SpecificBuildOnBranch
inside your build step.
Verification of the branch will be performed by the server before starting the assembly configuration Project_SubProject_SpecificBuildOnBranch
Line 2
Specified to work in several branches, as indicated below, you will make your own logic here.
source share