0

I am using TFS and Visual Studio 2017. I have two servers for load balancing purposes, both servers have identical release versions(In theory) of my MVC application.

The current release process is as follows:

  1. Take a backup of the existing root folder by copying all files into _old folder.
  2. Copy the release files onto the server manually i.e, Ctrl+c and Ctrl+v.

I do the same for Server 2.

I am wondering if there is a way to automate this.

I have tried the following: I created a publish profile which will publish to one server at a time, this is working however the backup of the existing files(i.e, step 1) is still manual and also I have to do this twice once on each server (i.e, had to create two profiles instead of 1)

I did try to tweak the pubxml file as below My *.pubxml file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>\\10.0.0.100\c$\Applications\TestApps\Test</publishUrl>
    <publishUrl>\\10.0.0.101\c$\Applications\TestApps\Test</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
</Project>

The above did not work, funny enough when i try and publish using this publish profile. Only Server 2 (10.0.0.101) picked up my change and Can anyone help.

I am using Visual Studio 2017 Visual Studio Team Foundation Server 15.117.26714.0

Abe
  • 1,879
  • 2
  • 24
  • 39
  • why do you copy manually instead of using the Publish feature in visual studio? Anyway yes a Powershell script could undoubtedly automate this. Or you could thoroughly modernise your processes and get into more DevOps-style automated build/test/release pipelines. There are a lot of tools you could potentially use. [Azure DevOps Services](https://azure.microsoft.com/en-gb/services/devops/) might be one to look into first - you can migrate your TFS source control to it quite easily for one thing, and also it inevitably plays nicely with other Microsoft stuff. – ADyson Oct 16 '19 at 14:10

1 Answers1

0

The only suggestions out there for MSDeploy are multiple profiles.

But you say you are using TFS: if you are using an up to date version of Azure Dev Ops server (the renamed TFS server) then deployment groups allow deployment to multiple servers.

Richard
  • 106,783
  • 21
  • 203
  • 265