How do I update an Octopus Deploy step template?
Published 25 May 2016
You can add the latest version of DLM Automation step templates to your Octopus Deploy library from the Octopus Deploy library website.
However, there's currently no way to update an old version of a step template that you've already added to your library.
Workaround solution
Instead of updating the step template directly, you can add the new version to your library and then replace any steps in Octopus Deploy that use the old version with ones that use the new version.
Here's the method we recommend:
- Rename the old template
- Copy and paste the new template from the Octopus Deploy Library website
- Find out which of your Octopus Deploy steps use the old template
- Replace the steps that use the old template
- Delete the old template
1. Rename the old template
Before you add the new template to your Octopus Deploy library, you need to rename the one it's replacing. This is because you can't have two templates in your library with the same name, and you can't delete the old template until you've replaced all the steps that use it.
- In Octopus Deploy, at the top of the page, click Library.
- On the Step templates tab, click the step template you want to replace.
- Click Settings.
- In the Name field, add a suffix, such as "old version".
- Click Save.
Now you've renamed the old template, you can add the new version to your library.
2. Copy and paste the new template from the Octopus Deploy Library website
- On the Octopus Deploy library website, go to the DLM Automation step templates.
- Click the template you want the latest version of.
- Click Copy to clipboard.
- In Octopus Deploy, at the top of the page, click Library.
- On the Step templates tab, click Import.
- In the Import window, paste the copied template into the empty field.
- Click Import.
- Click Save.
You now have two versions of the template in your library.
3. Find out which of your Octopus Deploy steps use the old template
Octopus Deploy can list all the steps that use the old template, so you know which ones to replace.
- In Octopus Deploy, at the top of the page, click Library.
- On the Step templates tab, click the old version of the template.
- Click Usage.
This shows a list of the projects where the template is in use.
Under the Action heading, you'll see the name of the relevant step in the project. - Make a note of these steps and the project they're in.
4. Replace the steps that use the old template
For each step that use the old template, you must create a new step that uses the new template. You should set all the fields to the same values as the original step. It's useful when you're doing this to have two browser windows open so you can copy and paste details from the original step to the new one.
- Open a new browser window and position the two windows side by side.
- In the new window, open Octopus Deploy and the project that needs updating, so that the two windows are identical.
- In the first window, click Process and select the step that needs replacing.
- In the first window, click Update.
- In the first window, in the Step name field, add a suffix, such as "old version".
- In the second window, click Process; click Add step.
- In the second window, click the new version of the template.
The first window now shows the details of the original step; the second window shows the replacement step with most of the fields empty: - Referring back to the first window or using copy and paste, complete all the fields of the new step so they're the same as the original.
- In the first window, click Save.
You've now finished with the first browser window and can close this. - In the second window, click Save.
- Click Reorder steps.
- Drag the new step so that it's below the old step in the sequence.
- Click Save.
Now you've made a new version of the step, you can delete the original:
- Click the options button for the original step:
- Click Delete and then click Delete again.
Repeat all this for any other steps in your Octopus Deploy projects that also use the old version of the template.
5. Delete the old template
Now you can delete the old version of the template because it's no longer being used by any Octopus Deploy processes.
- At the top of the page, click Library.
- On the Step templates tab, click the template you want to delete.
Click Settings.
Click Delete.
Click Delete step template.
Octopus Deploy won't let you delete a template if it's still being used in a project.
If Octopus Deploy tells you a template you're trying to delete is still in use, click Cancel and then click Usage to find out which steps are using it.
You've done it. You've replaced the Octopus Deploy step template with the new version.