Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can TeamCity pull from a tag instead of the tip when retrieving files from a Mercurial repository?

This is with version 5.0.2 of TeamCity.

like image 280
arathorn Avatar asked Feb 26 '10 00:02

arathorn


3 Answers

This question seems pretty dead, but here's what I did (I had to figure it out today):

TeamCity (I'm using 6.0) seems to swallow the '#' symbol in the uri, so you just need to make sure you put it in quotes:

"https://<username>:<password>@bitbucket.org/<your-account>/<your-project>#<your-release-tag>"

A few other quircks:

  • TeamCity may see the hash and try to populate the Branch Name textbox. Delete anything it puts in here as Hg doesn't seem to support this.

  • Because the url needs to be in quotes, you need to embed your username/password in the url (anything in the User name or Password text boxes will be ignored). TeamCity can't insert them like it normally would because of the quotes around the url.

like image 121
David Faivre Avatar answered Nov 03 '22 07:11

David Faivre


The latest version of TeamCity has added an option in the VCS Root config to specify which branch/tag to pull.

like image 38
arathorn Avatar answered Nov 03 '22 08:11

arathorn


I ran into a similar scenario, wherein we wanted to have a build configuration that would always build whatever was tagged as a production build. I solved the issue by switching checkout mode to "agent checkout" so that the agent working directory contains the entire mercurial repository, not just the latest files. I then added a build step before the actual build. All it does is:

hg update prod-build

after which the build can proceed on the correct version.

Note that this is on TC 6.5, but I assume custom build steps are in the cards for TC 5 as well.

like image 1
Rytmis Avatar answered Nov 03 '22 09:11

Rytmis