3

I am working on TFS 2012 Builds. I have created a build template to deploy Asp.net application and its working properly but its deploying full build every time. I need to deploy 1. Only changed files 2. I don't wanna deploy folders like 'Uploads or Attachments etc' 3. I don't want to deploy Web.config file

I have searched for MSbuild arguments but didn't get result , also SkipUnchangedFiles didn't work in 2012 TFS.

Can you guys help me achieve these result.

Thanks

Mahajan344
  • 2,492
  • 6
  • 39
  • 90
  • 1
    I would recommend upgrading to TFS 2015 and using the new build system – MrHinsh - Martin Hinshelwood Dec 10 '15 at 19:55
  • @MrHinsh Do you have a link that answers this question using the new build system? I saw your answer at the following question where you recommend always deploying the full application. That's what I've said to my clients but they insist it's not feasible. https://stackoverflow.com/questions/35730175/how-to-identify-files-that-have-changed-during-tfs-build-2015 – pabrams Nov 22 '17 at 21:13

1 Answers1

1

First, you can set Clean Workspace to None in the build definition. This will speed up the build times by only building what has changed. In this way, your output dir will contain all of the old and new files.

Then you can override the AfterCompile target to delete any file whose timestamp is older than (current time - 1hr). After the delete operation, your out dir folder will only contain the new files. The Build will then copy those files out to the Drop folder. Now your drop folder will have the files you need to deploy.

Check: https://social.msdn.microsoft.com/Forums/vstudio/en-US/32a4f153-846f-4acb-bcca-018d6143a50a/build-tfs-build-only-what-is-changed?forum=tfsbuild

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39