问题
How do I label my SVN project with TeamCity VCS labeling if I am using a checkout rule?
I read the checkout rule docs, but I'm having a hard time understanding the relationship between VCS labeling and checkout rules in TeamCity.
My SVN structure looks like:
https://my.internalsvn.com/(...)/myproject/branches/gattaca-dev
https://my.internalsvn.com/(...)/myproject/tags
https://my.internalsvn.com/(...)/myproject/trunk
In TeamCity, my VCS root is configured to:
https://my.internalsvn.com/(...)/myproject
When I run the build, I want it to be executed in the current working directory, so I set up a Checkout Rule that looks like:
+:branches/gattaca-dev => .
When I add the VCS Labeling build feature, it tells me:
Failed: Failed to set label 'build-6': No labeling rules found for checkout rules branches/gattaca-dev=>
What do I have to set so that the branch I am building (which is configured to "." from the checkout rule) gets tagged?
https://my.internalsvn.com/(...)/myproject/tags/build-6
How do I set the labeling rule for a checkout rule? Does it go in the checkout rule itself? Or do I need to edit the VCS root and make a copy for this specific build?
回答1:
I was able to make it work by using a %vcsBranch% parameter.
The labeling setting on my VCS root becomes:
%vcsBranch%=>tags
...and my Checkout Rule becomes:
+:%vcsBranch% => .
I'm not sure whether this is the best solution. I would've liked to be able to set up custom labeling rules just for this Checkout Rule, rather than hard-coding it in the VCS root. I couldn't figure out how to do that.
Additional feedback is welcome.
来源:https://stackoverflow.com/questions/36221691/how-do-i-set-up-a-teamcity-vcs-label-svn-when-using-a-checkout-rule