0
votes

I have a working Jenkins TFS setup, but can't figure out how to stop the Jenkins TFS plugin from deleting the whole workspace and downloading it again each time. I just want it to do the equivalent of "Get Latest" and not delete any files that are up to date.

Here is the message I'm getting in the console when this happens:

  • Deleting workspace as the configuration has changed since a build was performed on this computer.

I can't figure out what is causing this or how to disable this behavior.
This doesn't always happen when I build the project, so something is causing this to happen.
It can happen even if I don't change any configuration stuff in Jenkins.

Option to "Delete workspace before build starts" option is off.

I have found the message in the Java source for the TFS plugin here, but
don't understand what is causing it: Java TFS Plugin in GitHub

Environment:

  • Jenkins v2.60.3
  • TFS plugin 5.121.0
  • Windows 10 64-bit
  • Java 1.8

Console log when this happens:

Building on master in workspace D:\Jenkins\workspace\XXX
Deleting workspace as the configuration has changed since a build was performed on this computer.
Downloading list of workspaces from https://tfs.company.com/tfs/Projects...
Deleting workspaces named 'MASTER-XXX' from computer 'ALAN-XXX'...
Deleted 1 workspace(s) named 'MASTER-XXX'.
Querying for remote changeset at '$/XXX' as of 'D2017-08-29T09:46:26Z'...****

2
How did this message occurs, could you explain the environment and operation more clearly ? Also attach more detail log info for troubleshooting. - PatrickLu-MSFT
@Patrick-MSFT See above. Please tell me if you need any more details/logs. - AlanRicker

2 Answers

0
votes

In your Jenkins Project configure Page ,there is an option for deleting workspace before build starts in Build Environment section. Double check if you are checking this option or not.

enter image description here

0
votes

The plugin checks the latest build configuration and compare it with the current job. If there is any difference/change exist, you will see that message. The configuration it checks is the settings in "Source Code Management". Since you mentioned that it also occurs when you didn't do any change, I suspect that it may caused by some variables you used in "Workspace name" changed. You can also check and compare the "build.xml" for the two builds in Jenkins Jobs folder to see what change cause the issue you meet. enter image description here