I'm currently evaluation TeamCity 8.

We got several branches (master, development + feature branches) and a Artifactory setup. If the master/development snapshots are build successfully, they are being deployed to Artifactory. The problem is, that the feature branches get deployed into the development repository too.

I couldn't find a way to tell the artifactory plugin to ignore the other branches, but there is an option to include/exclude certain artifacts through their filename. However, the artifacts of the feature branches don't have any special naming.

Is there a way, to get the name of the branch into the pom.xml, so i could use it as a prefix for the artifact name? I found TeamCity variables like "teamcity.build.branch" but couldn't figure out how to include them, so that teamcity replaces them.

Does someone know how (or even a better way) to do this?

有帮助吗?

解决方案

The teamcity.build.parameter exposed by teamcity is a configuration parameter. To change it into a system /env parameter , in your build parameters , define a a system parameter whose value is always going to be %teamcity.build.parameter%

You can pass in properties into build files using system parameters . You can use the ${env.my_parameter} construct to get this value if it is an env variable or a ${system_parameter} construct to get its value if you define it as a system parameter

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top