Search code examples
tfsautomationbuild-definitionshelveset

TFS Build Definition to shelveset files already present in a mapped directory


I am currently working in TFS 2013 and am trying to implement a part of build definition where it would create a Shelveset from jars or other files that are already present in the VM's directory.The problem is that in order to do an add there has to be a mapped directory. If the file is the same after a tf add then it does not get detected as pending changes. Pretty much the benefit would be that users can pull the shelveset and get those files in their local workspace which are needed to run some automation. So the sequence is as follows

Add Jar Files: tf "add " + """" + BuildDirectory + "\" + ProjectBaseDir + "\" + "\lib*." + """" + " /noignore" + " /recursive" + " /noprompt" + " /lock:None" Add other files: tf "add " + ".*" + " /noignore" + " /recursive" + " /noprompt" Shelve changes: tf "shelve /move /replace /noprompt " + """" + ShelvesetName + """"

I apologize if its a little confusing. Does anyone have any ideas or workarounds using tfs?


Solution

  • According to your info, suppose you want to add something of your build result to shelveset then pull or copy the shelveset in local workspace to run some automation.

    You can add the InvokeProcess activity in build process template to execute the xcopy command line to copy files from source to destination. Please refer to the example for more details in this article: Customize Team Build 2010 – Use more complex arguments

    Or upgrading to TFS 2015 to use Vnext Build