Rules to Better Octopus Deploy - 4 Rules
Every release needs to have a version number. However, version numbers need to be generated during the Build phase not the Release.
Imagine the following scenario: Your Build system generates a NuGet package with version 188.8.131.52 that is pushed to Octopus Deploy NuGet feed. In Octopus Deploy you create a release using the default configuration. When you create a new release you will see 0.0.1 instead of 184.108.40.206. As you can imagine, it is impossible to tell from the release what version number of the application was really deployed. Hence you should change the versioning and use the package version instead.
Bad Example - Version number is auto-generated by Octopus Deploy
Good Example - Version number is inherited from a NuGet package
One of the best features of RayGun is the ability to track crash reports against deployments. This feature allows you to tell if a particular deployment has introduced a lot of new bugs or caused a regression of exceptions.
To set it up:
- Under Deployments
- Select Octopus Deploy (Set up)
Raygun will product you with a PowerShell script to add into your octopus deployment steps that will call the RayGun API and log a new deployment
- Trigger a new deployment
- Then you’ll see the deployment in RayGun
- New errors
- Recurring errors
When you run Octopus Deploy setup the application installs to you %Program Files%\Octopus Deploy folder. If you installed Octopus Server you will see Server subfolder and if you installed Octopus Tentacle then it will be Tentacle. However, this is a folder where Octopus Deploy bits live, not your applications, packages, etc. Those artifacts live in the Home folder that you specify during the Octopus Setup Wizard the first time you configure the Server/Tentacle.
By default the Home directory points to %SystemDrive%\Octopus which is not great. The main reason is that the Home folder is constantly growing and clogging up your OS drive. So you need to point the Home folder to a new drive e.g. D:\Octopus
Bad Example - Home directory is pointing to %SystemDrive%
Good Example - Home directory is pointing to another drive
Octopus Deploy will by default keep all packages (NuGet, ZIP, …) as well as files deployed on all Tentacles. Because of that your hard drive will fill up very fast as you keep pushing in more packages and creating more releases, especially if you are using Continuous Integration and pushing out new packages with every commit to a repository.
That's why you need to set up a retention policy. Octopus Deploy supports two options:
- Retention policy for packages
- Retention policy for deployments (via Lifecycle phases)
You should set up both.
Bad Example - Retention policy is set to Keep forever
Good Example - Retention policy is set to a number of days
Bad Example - Lifecycle's retention policy is set to Keep all
Good Example - Lifecycle's retention policy is set to 3 Releases