how to Configure Task for deployment project?

My project Build Successfully by MSBUILD and loaded build file in Shared Artifacts. now how to Canfigure Task for Deployment Download Build files from Artifacts and Transfer my server location and which one best for Project like (MSDeploy) or others. please give me sample example.

1 answer

Assuming IIS, there are 3 components to take care of.

  1. Move the files
  2. Establish Application Pool
  3. Establish Web Application

For moving the files, I just use a network share and move stuff over using a filter to remove source code files*. The AppPool can be setup once and forgot in a lot of case but I prefer to keep all the setting in version control along with the application(s) using it; in our case almost every application has it's own AppPool so it is easy to manage. The WebApplication is telling IIS that have more than .html/images/css and typically want the Asp.netengine, you can also setup bindings there. So onto the how, I use powershell. Powershell scripts are added to the version control of the application and has some easy access to IIS control via the WebAdmistration module and since by AppPool only have one application I can easily deleted them and push new ones with the version controlled.

$appName = "YourApplicationName"
Import-Module WebAdministration
if (Test-Path "IIS:\AppPools\$appName")
{	Remove-WebAppPool $appName	}
if (Get-WebApplication -Name $appName)
{	Remove-WebApplication -Name $appName -Site "Default Web Site"	}
# Redacted copying files over

$appPool = New-WebAppPool $appName
# Redacted user information
$appPool.processModel.userName = $user
$appPool.processModel.password = $password
$appPool.processModel.identityType  = 3
$appPool.managedRuntimeVersion = "v4.0"
$appPool | Set-Item

New-WebApplication -Name $appName -Site "Default Web Site" -PhysicalPath "C:\inetpub\wwwroot\$appName" -ApplicationPool $appName

I removed our file copying to keep it pertinent and user information for obvious reasons but powershell can access some Marshall operations really easily and safely store passwords for you on the target machine(s).

*Wanted to show the script then explain, we move other everyone but source code so including the install script to the target machine in a temp folder then execute the install script locally on the target machine. We've been plagued with file copying issues and downtime latencies which were solved with that approach.

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

229 views 6 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot