Octopus Deploy - Part V - Extras

For our fifth post about Octopus Deploy, we'll share some additional information and troubleshooting tips.

1. Visual Studio setup
2. Team Foundation Server setup
3. Octopus Dashboard setup
4. Project Features
5. Extras


Troubleshooting Tips

Below are some common issues we ran into during the Build setup.
  • If you get a "...NuGet.exe restore ... exited with code 1." error, a possible fix is to clear the NuGet cache on the build server
    • Delete all files in %LocalAppData%\NuGet\Cache
  • If you get a 400 Bad Request error and a "...NuGet.exe push ... exited with code 1." error
    • You may be trying to re-publish the SAME VERSION of the package
    • See the Versioning section below to properly set it up
  • Not all TFS templates seem to work as expected. 
    • If you're creating a new build, use the DefaultTemplate.11.1.xaml OR the GitTemplate.12.xaml for GIT-based solutions


Multiple Solutions and/or Branches

  • If you have the same solution name for several Octopus projects (a good example is when using multiple branches that need to be deployed in separate projects)
    • Add another MSBuild argument /p:OctoPackProjectName=AlternateName
    • Update your Octopus Step Package Name ID to the new name
  • If you have multiple branches that serve different environments then an option is to
    • create a separate Lifecycle and Project for each e.g. Sample-Internal and Sample-External projects each with its own Lifecycle
    • To avoid the name collision, use the previous tip with an Alternate Name for your NuGet package since both branches will have similar solution names e.g. Sample.Web.sln


Versioning

You need to enable versioning to avoid deployment issues and keep track of your application versions, there are tow main options to pick from:

Option 1 - Assembly

  • Within you main project e.g. Sample.Web, add the version number within the AssemblyInfo.cs file

[assembly: AssemblyVersion("1.5.*")]
  • This number will typically be increased with each release e.g. 1.6.*
  • In Octopus, under Project > Settings, set "Release Versioning" to "Use the version number from an included NuGet package"


Option 2 - Octopus

  • In Octopus, under Project > Settings, set "Release Versioning" to "Generate version numbers using a variable template"
  • Under "Version Template" modify the template as needed OR use the default template
[#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}


[original publish date: 12/12/15]

Comments

Popular posts from this blog

ASP.NET Identity Remember Me

IIS Express Client Certificates

ASP.NET MVC - How to enable/disable CaC/Client Certificate authentication per area or route.