TheWebGuy
TheWebGuy

Reputation: 12525

Creating nuget package for Octopus deployment

I have a cloud service project. After revewing the documentation at http://docs.octopusdeploy.com/display/OD/Windows+Azure it mentions I have to create a nuget package with cloud service package (*.cspkg) along with the service configuration file.

I went ahead and wrote this script to do that:

msbuild.exe ../Eff.Cloud/Eff.Cloud.ccproj /t:Publish /p:VisualStudioVersion=12.0 /p:RunOctoPack=true
nuget pack ../_build/Eff.nuspec

I run this after building my project in Team City, but I don't see this package appearing as an artifact in Team City, any idea what I am doing wrong? When I run it locally it creates a package in the _Build folder.

Is there an easier way to do this with Octopack?

Thanks!

Upvotes: 2

Views: 3185

Answers (2)

Vladimir Moushkov
Vladimir Moushkov

Reputation: 179

There three ways of doing Octopus nuget package:

  1. Using OctoPack nuget package. Requires explicit reference to the project that to be published.
  2. Using NuGET.exe. Deficiency - requires package.nuspec file.
  3. Using Octo.exe. Just run "Octo.exe pack" in any directory. There is algorithm will track files required to be packaged that works as expected (at least for csproj projects). IMHO this works the best, as only requirement is Octo.exe to be available on the build machine.

For more information http://docs.octopusdeploy.com/display/OD/Packaging+applications

Upvotes: 1

ihatemash
ihatemash

Reputation: 1494

This is how I got it working for TeamCity 9.X.

  1. In VisualStudio, I add the OctoPack Nuget package to every project I needed to generate Nuget packages for.
  2. In TeamCity, I navigated to Administration|Plugins List
  3. Then downloaded the NuGet plugin from https://confluence.jetbrains.com/display/TW/NuGet+support
  4. I upload the NuGet plugin using the "Upload plugin zip" link at the top of the screen and restarted TeamCity.
  5. Once TeamCity was back up, I navigate to the Administration page and select NuGet under Integrations on the left side of the screen.
  6. Then I selected NuGet.exe tab at the top to select the version of Nuget.exe I wanted to use.
  7. I clicked on "Fetch NuGet" and picked version 2.8.2 from the dropdown.
  8. Then I edited my build step that builds the solution and checked "Run OctoPack".

Now my NuGet packages show as build artifacts.

Some assumptions I made were that you are using TeamCity 9.X and that you have a build step that uses Visual Studio as the runner type. Hope this helps.

Upvotes: 1

Related Questions