ASP.NET 5 (vNext) Deployment via TFS 2015
Asked Answered
T

2

6

We're trying to work through the new tool chain for building and deploying an ASP.NET 5 (vNext) CoreCLR web site to a server cluster. Between the new compilation changes and the changes to TFS, I'm not sure how everything now gets built and deployed. The scenario is as follows:

  1. On-premise TFS for source control and build agent
  2. Targeting ASP.NET 5 under CoreCLR, hosted via IIS

Questions are:

Using TFS for continuous integration builds (and hopefully deployment to an on-premise IIS server), how does one build and deploy this new application type?

It seems like MSBuild might still be usable to point at a .sln file so as to indirectly invoke dnu.exe, is that correct? Is that the appropriate way to do that now?

Should we be running a scripted build task instead to run dnu.exe instead?

How are these new CoreCLR builds deployed? Just a straight copy to a directory on a remote machine?

This is a new application and we're using a multi-layered application architecture, where the DAL and Business logic are in their own CoreCLR projects, if that makes a difference.

Thanks in advance for shedding some light on the situation.

Tonie answered 10/11, 2015 at 4:2 Comment(0)
T
6

Here is what we ended up doing:

  1. Powershell script "prebuild.ps1" as per the previous answer and Microsoft deployment guidelines: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5

  2. Vanilla MSBuild build. no switches or special settings.

  3. Powershell script to execute xUnit test runner. We used guidance from this post at http://fluentbytes.com/running-xunit-test-with-asp-net-dnx-and-tfs-2015-build/

  4. Powershell script to run "dnu publish". This creates a directory of the entire web application's structure.

  5. "Windows File Copy" task to deploy the directory structure created in #4 to all of the target machines in the test environment.

Tonie answered 21/11, 2015 at 9:19 Comment(0)
U
1

To build and deploy ASP.NET 5 via TFS2015 vNext build system, you need to:

1). Create a PowerShell script (named Prebuild.ps1, for example) to install DNX. Details of the PowerShell script can be found: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5 . Add the script file into TFS version control.

2). Add the PowerShell script build step into build definition. Run the Prebuild.ps1 script in this step:

enter image description here

3). In the MSBuild step, specify the project needs to be built, and add the following /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=InProc /p:MsDeployServiceUrl=localhost /p:DeployIisAppPath="Default Web Site/TFSTest1" /p:VisualStudioVersion=14.0 to publish the project to IIS.

Unearth answered 16/11, 2015 at 8:0 Comment(2)
Sorry but deploying with msbuild is just wrong. There must be an msdeploy step that takes the same set of promoted binaries and pushes them to the target. Whether parameters.xml or powershell are used to finalize the config is academic.At present, standalone TFS vNext is unsuitable for proper release management and some additional piece such as Octopus Deploy is necessary.Koheleth
+1, totally agreed, and I would even add that TFS is not (cl)aiming to be in the release management space, and should not be (ab)used as such. This is where release process related bolt-ons to CI build systems become such a nightmare in anything but a straightforward and simple environment set-up. It is where tools like Octopus Deploy come into their own.Anaplasty

© 2022 - 2024 — McMap. All rights reserved.