How to deploy non VS projects to iis web deploy?

1.1k Views Asked by At

I have an Angular application and hosted in IIS. I want to deploy this application using Web Deploy.

I know VS solutions (.sln) could be deployed using MSBUILD and Publish Profiles.

How to deploy non VS, static applications using web deploy?

I'm looking for an option to deploy from a Bamboo build server to a remote IIS target.

3

There are 3 best solutions below

3
On BEST ANSWER

As Lex Li says, if you want to publish a hosted angualr application to another IIS by using web deploy, you could use web deploy sync method.

If you just want to sync 2 folders directly root-to-root, you could try below command:

Notice:The webdeploy tool normally is inside the C:\Program Files (x86)\IIS\ folder, you need firstly locate it.

>msdeploy  -verb:sync -source:dirPath="D:\my-app\dist" -dest:dirPath="D:\AnTest"

enter image description here

If you want to include IIS configuration on the destination, you should use iisApp provider instead of dirPath:

>msdeploy  -verb:sync -source:iisApp=<SourceFolderOrIISPath> -dest:iisApp=<DestinationFolderOrIISPath>
0
On

I have gone with the following approach:

  1. Setup dist folder of angular project at angular.json => projects > your_project > architect > build > options > outputPath > your_dist_folder

  2. build Angular project

  3. On Visual Studio inside a solution right click > Add Existing Website and choose the folder of the built angular code

  4. Right click on the new website > Publish Web App

  5. Create Web Deploy Profile

  6. Publish with the new profile

0
On

Install msdeploy on the bamboo agent. Use the script task and use this line:

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:iisApp=<SourceFolderOrIISPath> -dest:iisApp=<DestinationFolderOrIISPath>

If you have another path to the msdeploy you enter that path instead.