deploymentoctopus-deploynuspecoctopack

Octopack packaging windows service as if it were a web site


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??


Solution

  • 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.