1

I have a windows service which contains the necessary components to allow it to render razor templates. This service listens on a message queue and sends emails, using the razor templates to generate rich html.

Everything is working fine, however, when it comes to deploying it with Octopus Deploy, it seems that OctoPack is seeing this service as a web site and packaging it incorrectly.

Before adding the razor template feature, this service used to get packaged correctly and was able to deploy with no worries.

The packaged output now looks like:

enter image description here

When in reality, it needs to just contain the contents of the bin folder. It seems to me as if OctoPack is treating the service as a website now.

I have tried adding a nuspec file, but that doesn't work, I end up with:

enter image description here

Nuspec file looks like:

<!-- cut for brevity -->
<files>
  <file src="bin\**\*.*" target=""/>
</files>

So that doesn't work either.

What can I do to fix this??

Simon
  • 2,810
  • 2
  • 18
  • 23

1 Answers1

1

I managed to hack something together to solve the problem I was having. After looking at the Octopus Deploy docs, I found that I could pass a OctoPackNuGetProperties property to msbuild and replace the config name in the nuspec file.

So the nuspec file now looks like this:

<files>
  <file src="bin\$config$\**\*.*" target="" />
</files>

and I now pass /p:OctoPackNuGetProperties=config=Deploy to msbuild, which means that OctoPack now packages the service bin correctly.

I'm still interested to hear from someone at Octopus as to whether this is an issue with OctoPack or whether it's to do with how I've set things up though.

Simon
  • 2,810
  • 2
  • 18
  • 23
  • You can view the source code for the OctoPack on Github: https://github.com/OctopusDeploy/OctoPack/tree/master/source That said, this is *likely* intentional because the OctoPack is simply a wrapper around NuGet.exe. The additional MSBuild parameter as you so discovered was a way to customize your package, as well as modifying the NuSpec. Since the Octopus server has no integration with your build process, how you create your packages is outside of the Octopus server. Only through customization as you've done with your NuSpec and MSBuild, you can deploy *anything* with NuGet and Octopus. – osij2is May 05 '15 at 15:37
  • It's not an issue with OctoPack. If you have a web.config file in there, OctoPack assumes you have a web project. As osij2is pointed out, you can view the source. Specifically, look in [this file](https://github.com/OctopusDeploy/OctoPack/blob/master/source/OctoPack.Tasks/CreateOctoPackPackage.cs) and have a look at the `IsWebApplication()` function. – JamesQMurphy Mar 26 '16 at 01:53