2
votes

I am new to this, so please excuse my ignorance if this is something very basic.

I use the following commands in the 'Execute windows Batch command' tab in a Jenkins job -

cd "C:\Data\Projects\<project name>\00_Mainline" 

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\TF.exe" get "$/Analytical/<project name>/00_Mainline" /force /recursive 

This works well if I type it in a command prompt; but when this is run from Jenkins, I get the following error -

Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.

After going through several threads in this site, I added

pushd "C:\Data\Projects\<project name>\00_Mainline"

to the top of the script. But this didn't help either.

Any ideas?

Regards, Sudhi

1

1 Answers

3
votes

Since you haven't specified otherwise I'm going to assume Jenkins is running under a different user account, in which case there may not be a workspace for the Jenkins account.

In any case, in Jenkins you might need to use the tf workspace command to create a new workspace, and then the tf workfold command to set up a folder mapping before you can do the tf get.