Deploy multiple IIS Web Sites from a single package

(konstantine) #1

We have a number of IIS web sites which supposed to be deployed together and come from the build process as a single ZIP package where each site is a subfolder inside ZIP. Octopus requires each IIS site deployment to be separate step. (BTW, is this true? Can we deploy multiple sites as actions within the same step?) That step requires the package to be specified. So is Octopus smart enough to download and unpack the package only once, so that after the first site is deployed others reuse the same unpacked package folder only pointing to a different subfolder within it?

Thank you!
Konstantin

(Henrik Andersson) #2

Hi Konstantine,

To accomodate your scenario you can’t use the built-in deploy package step as it has to download the package, so in your case Octopus would download the package 3 times into 3 different folders. Now, what you can do is the following:

1. Add a deploy package step to your project and configure it with your package (don't enable any IIS related features in the step)
2. Add a project variable and set the value to `#{Octopus.Action[NameOfTheStepAbove].Output.Package.InstallationDirectoryPath}`
3. Add a [Create Virtual Directory step](http://library.octopus.com/step-templates/2cfbcd72-cf43-43fd-8291-9bb564cc512c/actiontemplate-iis-virtual-directory-create) (or [Create Application](http://library.octopus.com/step-templates/5b3e7576-44f8-4852-ae09-a45bd985c549/actiontemplate-iis-application-create) or [Create Website](http://library.octopus.com/step-templates/74c6ab38-f56c-4637-918c-1b46b4e24049/actiontemplate-iis-website-create)) for each of your web sites in your package
  3a. Set the Physical Path to `#{VariableNameCreatedAbove}\NameOfSubFolderInPackage`
  3b. Configure the other settings as appropriate

Hope that helps!

Thank you and best regards,
Henrik

(system) closed #4