# IT:AD:TeamCity:Hg # * [[../|(UP)]] {{indexmenu>.#2|nsort tsort}} --- ## PreRequisites ## * Install TortoiseHg * Easy to forget (we're so used to having it installed locally, that one forgets that to do a CheckOut, TeamCity will need to have Hg available...) * Ensure you've configured it to get through the corporate proxy if any ([[IT/AD/Mercurial/]]) * for the account TC is running under (eg: `DEV\258-TeamCity-Svc`)*. * *Tip:* that's one of the reasons one has to ensure that the Website is not running under `LocalSystem` account -- it has no %UserProfile% directory to do this step in... * The account has to be a CORP one, not a DEV one... ## Administration/Edit Build Configuration/Edit VCS Root ## * Edit VCS Root: * Type of VCS: `Mercurial` * VCS Root Name: `null` * HG Command Path: `c:\Program Files\TortoiseHg\Hg.exe` * `%ProgramFiles%` doesn't sem to work * It's `TortoiseHg` -- not `HgTortoise` ... * Pull changes from: https://bitbucket.org/skysigal/test * Branch name: `null` * Cone repository to: `null` * Use Cuncompressed transfer: `false` * UserName: `skysigal` * Password: `XXXXXX` * Build Step * [Documentation:MSBUILD](http://bit.ly/rShk5A) * Runner Type: `MSBuild` * Build File Path: * Trigger * VCS Trigger = `60 seconds quite` References: * http://bit.ly/rp9CrU ## NuGet ## * [[IT/AD/TeamCity/Nuget/]] ### Installation ### * Procedure: * Find TeamCity Data directory * C:\_System\TeamCity\.BuildServer\plugins\ * Stick downloaded zip there * Stop TeamCity server * Start TeamCity server * You'll see a new tab on Server Administrator page * Using NuGet Install option from behind Proxy failed. * Instead: * chose `Custom` and defined a path. That said space in `c:\Program Files\` caused it to fail. Worked when installed to `c:\Nuget\`. Might have worked as well if I chosen an %env....% defined path. * Found this alternate Workaround mentioned on web: [http://bit.ly/tfQEHR](http://bit.ly/tfQEHR) that led to [http://bit.ly/sEvdSG](http://bit.ly/sEvdSG) * Resources: * http://blogs.jetbrains.com/dotnet/2011/08/native-nuget-support-in-teamcity/ * http://confluence.jetbrains.net/pages/viewpage.action?pageId=40702877 #### Packaging #### * Worked: * `XAct.Core.nuspec` was placed beside `XAct.Core.csproj` * TeamCity settings: * Specification file: `XAct.Core\XAct.Core\XAct.Core_Debug.nuspec` * Base Directory= `XAct.Core\XAct.Core` * Path = (Custom) `c:\Nuget\Nuget.exe` * Cons: * A lot of custom work in the *.nuspec * Issues: * Using `XAct.Core.csprog` I get: * pack: ...The imported project "`...\work\f5a3a0936d0bc94c\xact.core\.nuget\NuGet.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.`" * Note: The include statement in question is: * `` so it appears that the NuGet build step thinks the solutionDir is ...?! * References: * http://bit.ly/rp9CrU * http://bit.ly/spRES8 ## Version Number ## * As usual, a huge bitch. * Curently am using the [AutoIncrementor Plugin](http://confluence.jetbrains.net/display/TW/Autoincrementer) to keep the number synced across builds. It really isn't good enough. * Am using %autoinc.CSFFXActLib% in the format string. * Saw this: interesting [http://stackoverflow.com/a/7427933](http://stackoverflow.com/a/7427933) but don't know how to put it to use... * According to [http://bit.ly/sIRmHB](http://bit.ly/sIRmHB): * "1.0.{build.vcs.number.1}" * But that gives the hash and fails at build. * To do one day: [http://jake.murzy.com/post/3099699807/how-to-update-assembly-version-numbers-with-teamcity](http://jake.murzy.com/post/3099699807/how-to-update-assembly-version-numbers-with-teamcity) ## Team City NuGet Server ## [[IT/AD/TeamCity/Hg/Nuget/]]