Jenkins Build Fails when trying to using MSBuild Extensions - Unable to determine the source control server

StackOverflow https://stackoverflow.com/questions/19390803

Question

I am trying to use Jenkins in combination with MSBuildExtensions and TFS to transform AssemblyInfo.cs

On my dev box, everything works, fine, including the connection to TFS, which returns the changeset number correctly.

When I check in a changeset, and try and build on the Jenkins server, I get an error and the build breaks on this command:

  Resolve TF.exe path
  TF.exe path resolved to: C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\..\IDE\tf.exe
  TF Operation: GetChangeset
  Executing C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\..\IDE\tf.exe changeset   /login:myDomain\SomeUser,myPassword /latest /noprompt

C:\Program Files\Jenkins\jobs\DemoVersioning\workspace\VersioningDemo\VersioningDemo.csproj(513,3): error : Exit Code 100. Nothing Succeeded: Unable to determine the source control server.

In my msbuild script, this is the TFS command I am running on "BeforeBuild":

<TfsSource TaskAction="GetChangeset"
                     Login="myDomain\someUser,password">
    <Output TaskParameter="Changeset" PropertyName="ChangeSet" />
</TfsSource>

I think this has something to do with the workspace being missing - but Jenkins pulls everything down fine, so shouldn't the workspace exist?

Some guidance would be appreciated as I am starting to go bald over this.

Was it helpful?

Solution

Supporting Material:

Can you do a TFS get without needing a workspace?

Solution 1:

By-pass the TFS voodoo, get Git for TFS, and run the below.
(This would be the equivalent of "svn.exe 'export'" if you know that world.

"C:\MyProgFiles\GitTF\git-tf.cmd" clone http://MyCoolteamfoundationserver:8080/tfs/ $/MySolution/

Solution 2:

Create the workspace and map it and then "get" the code.

Here is a .bat version that you would mimic:

set __MYWORKSPACENAME=CI_TEMP_WORKSPACE

set __BASEDIRECTORYFINAL=c:\ci_build_stuff\

MD %__BASEDIRECTORYFINAL%
CD %__BASEDIRECTORYFINAL%

set __tfExe=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe

"%__tfExe%" workspace /new %__MYWORKSPACENAME% /collection:http://my_super_cool_teamfoundationserver:8080/tfs/my_cool_projects /noprompt

"%__tfExe%" workfold /map $/MyTFSPath %__BASEDIRECTORYFINAL%\SXA

"%__tfExe%" get %__BASEDIRECTORYFINAL%\MyTFSPath\ /recursive /noprompt


set __BASEDIRECTORYFINAL=
set __MYWORKSPACENAME=
set __tfExe=

Further thoughts:

Checkout

http://msbuildextensionpack.codeplex.com/workitem/11709

That might have some built in workspace voodoo in it, that isn't there on the changeset.

Get the source code and look around, it'll tell you what's going on.

I see this one:

http://msbuildextensionpack.codeplex.com/SourceControl/latest#Solutions/Main/TFS/TeamBuild.cs

   public class TeamBuild : BaseTask
    {
        private const string GetLatestTaskAction = "GetLatest";
        private const string QueueTaskAction = "Queue";
        private const string RelatedChangesetsTaskAction = "RelatedChangesets";
        private const string RelatedWorkItemsTaskAction = "RelatedWorkItems";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top