2

I have a VS 2013 solution consisting of a classlibrary and a website. The code is under source control in TFS 2013, and i want to setup nightly builds of the solution where the website is placed in a specific unc path which is a webroot on a test server.

Currently i have a build running for the solution which resultes in a output folder on the unc path named by the build definition and the build number format with a subfolder named "_PublishedWebsites" containing the website. What i want is to have the website deployed with its name to the unc path without any build definition in the folder:

What i want:

\192.x.x.\TFS\WebApplication1\

Current:

\192.x.x.\TFS\Build definition one\Build definition one_20140408.29_PublishedWebsites\WebApplication1\

I suppose there is a simple way of doing this, but no matter how i configure the build definition or setup a custom build template, i end up with either no code being copied to the unc path, or some build error because i simple cant grasp how to configure the template.

There are lots of guides and questions here on stackoverflow for this, but i have not been able to find one for TFS 2013 which explains my scenario step by step.

So what are the steps for creating a TFS build definition where the result is a compiled web applicaiton placed in a specific named unc path folder?

1 Answers1

1

You'll need to edit the process build template for this build definition. You can use your current template by downloading it through the "Process" tab of "Edit Build Definition", it will be at the top. Look for a line similar to this:

<mtbwa:CopyDirectory Destination="[UNCDestinationRoot + BuildDetail.BuildNumber]" sap:VirtualizedContainerService.HintSize="234,22" Source="[BinariesDirectory + WebsitePathInBuild]" />

And change it to this:

<mtbwa:CopyDirectory Destination="[UNCDestinationRoot]" sap:VirtualizedContainerService.HintSize="234,22" Source="[BinariesDirectory + WebsitePathInBuild]" />

Finally, use the modified XAML from your existing template to create a new Build Process Template. Refer here for help: http://msdn.microsoft.com/en-us/library/dd647551.aspx

Note: You won't actually need a project to house your XAML as described at the link above. You can just save the XAML and modify it with any text editor (though editing in visual studio will give you the flow diagram).

alan
  • 6,705
  • 9
  • 40
  • 70