1

I'm tasked with setting up CI/CD for my company. I'm using TeamCity which I have configured using the Octopus Deploy plugin to create a Nuget package to the appropriate dev server (alternatively, I can have TeamCity spit out a .zip).

The package itself is a solution that contains several projects, and each project needs to be deployed to different folders on IIS. Is this something that I can accomplish with Octopus Deploy, and if so how?

I've looked through the documentation and spent a lot of time Googling but I haven't found an example of someone doing this but I want to use Octopush Deploy because of the reporting and flexibility it provides (since I will need to set up pipelines to other environments in the future).

Information about the solution and environment: Multi-project solution .NET Framework 4.6.1 IIS version 6.2 Windows Server 2012 R2 Octopus Deploy v6.0 on-site TeamCity Professional 2019.1.1 (build 66192)

The solution is currently deployed on ISS like this:

Snippet of IIS setup of multi-project solution

Any assistance provided or links to resources is deeply appreciated.

Kind regards.

1

It can be achieved, however, you will make your life easier if you modify your TeamCity build process to create a package for each IIS Website then deploy each one individually using a Deploy to IIS step.

If it's impossible to change your build process then you will need to do some pre-processing or just deploy the websites through a custom script.

4
  • so I would either create a PowerShell script to split the different projects from the .zip or Nuget package first and then use separate Octopus Deploy steps to deploy each project to IIS separately or modify TeamCity to spit out a separate package per project and have Octopus Deploy use Deploy to IIS. Is the latter option best practice? Note: I have added a screenshot to the OP to show how I need to set-up the deployment.
    – HQ216493
    Nov 7 '19 at 17:43
  • 1
    Yes, splitting out your packages is best practice. Break stages down into small components so that you get better feedback loops, I.e if /api fails then you know you need to look into the API. Nov 7 '19 at 17:58
  • Okay, I'll look into how to get TeamCity to take a multi-project solution and output multiple packages ready for Octopus Deploy to grab them. Off-hand do you have any resources that I should look at to do this?
    – HQ216493
    Nov 7 '19 at 18:52
  • Create multiple Nuget packages with multiple nuspec files. docs.microsoft.com/en-us/nuget/create-packages/… Nov 7 '19 at 18:55
0

I managed to resolve this by installing the Nuget package Octopack on the projects that I wanted to be deployed as either separate websites or website applications.

In this context, I installed Octopack to the 3 projects in green squares and checked-in the changes. Then on the Octopus Deploy side, I created 3 separate IIS deploy steps and just followed the typical steps. Octopus deploy now receives a NuGet package from TeamCity using the Octopus deploy plugin, Octopack build step, from there Octopus deploy has 3 IIS deploy steps, one for the main website and 2 for the website applications, each was given a custom directory path but after I had installed the Octopack NuGet packages into the appropriate projects in the solution through Visual Studio it was smooth sailing just using the general user-guide and tutorial videos.

@richard slater - Thank-you for letting me know about Octopack and nuspec, these were some of the key missing pieces that I needed.

TLDR - If you want to deploy projects in a solution as separate websites, install the Octopus Deploy plugin to TeamCity and follow the basic tutorials, add the Octopack NuGet package to the projects you want as separate websites or web applications, set-up the Octopack step to push to Octopus Deploy over the API and use IIS steps in Octopus Deploy and you should be golden.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.