1
votes

I am porting over an MSBuild script from CCnet to run in Jenkins. The MSBuild project is used to create a deployment package. I would rather have Jenkins drive this process itself but that's a longer term aim.

The problem i am having is (as in the title) when we try and use the HgPull target, from the MSBuild mecurial task (http://msbuildhg.codeplex.com/) we get the error message

HgProcessException: The command hg.exe is not available [Path to project]

I have seen on the project web site that someone solved it by adding the LibraryLocation proeprty to the target but that seems to have made no difference. My target currently looks like this:

Target Name="UpdateSources">

<HgPull
        LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
        Force="true"
        Update="true"
        LocalPath="$(SourcePath)" 
        />

<HgUpdate
        LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
        Clean="true"
        LocalPath="$(SourcePath)" 
        />

I'm rather at a loss. Please let me know if you need any more information added to this post to solve this issue. I'm really quite new to MSBuild so really not sure where to start investigating this.

EDIT:

One thing i forgot to mention was that i have tried running the MSbuild command in a console window on the build server and still get the same result. This is really odd given it works fine in CCNet, what magic is CCNet doing to make this command work?

2

2 Answers

1
votes

This is now resolved, unfortunately i'm not sure what changes i made to correct these. I believe it may have been down to path separators and whether they where trailing or not in another part of the config file. It does so annoy me with the lack of resilience/consistency between applications where you need to specify paths with/without trailing slashes.

0
votes

Just a thought, but try adding 'C:\Program Files\TortoiseHg' to your system path. Maybe CCNet has it specified somewhere that Jenkins doesn't have access to.

Also, just for sanity's sake, verify that hg.exe actually exists at that location.