DLM Automation 2

How do I update an Octopus Deploy step template?

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:

  1. Rename the old template
  2. Copy and paste the new template from the Octopus Deploy Library website
  3. Find out which of your Octopus Deploy steps use the old template
  4. Replace the steps that use the old template
  5. 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.

  1. In Octopus Deploy, at the top of the page, click Library.
  2. On the Step templates tab, click the step template you want to replace.
  3. Click Settings.
  4. In the Name field, add a suffix, such as "old version".
  5. 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

  1. On the Octopus Deploy library website, go to the DLM Automation step templates.
  2. Click the template you want the latest version of.
  3. Click Copy to clipboard
  4. In Octopus Deploy, at the top of the page, click Library.
  5. On the Step templates tab, click Import.
  6. In the Import window, paste the copied template into the empty field.
  7. Click Import.
  8. 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.

  1. In Octopus Deploy, at the top of the page, click Library.
  2. On the Step templates tab, click the old version of the template.
  3. 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. 
  4. 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.

  1. Open a new browser window and position the two windows side by side.
  2. In the new window, open Octopus Deploy and the project that needs updating, so that the two windows are identical.
  3. In the first window, click Process and select the step that needs replacing.
  4. In the first window, click Update.
  5. In the first window, in the Step name field, add a suffix, such as "old version".
  6. In the second window, click Process; click Add step.
  7. 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:
  8. 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.
  9. In the first window, click Save.
    You've now finished with the first browser window and can close this. 
  10. In the second window, click Save.
  11. Click Reorder steps.
  12. Drag the new step so that it's below the old step in the sequence.
  13. Click Save.

Now you've made a new version of the step, you can delete the original:

  1. Click the options button for the original step:
  2. 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.

If you use the Chrome browser and you have a lot of projects you would need to update, it might be worth looking at the Bluefin extension (http://bluefin.teapotcoder.com/) to update the step template in multiple projects at once. You'll still need to follow the above steps to update the first step template, but it may help you update your other usages more easily. Please note that this is a third party extension and not a Redgate product or an official recommendation - it may not work in all cases and it is advisable to check the results of using it carefully.

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.

  1. At the top of the page, click Library.
  2. On the Step templates tab, click the template you want to delete.
  3. Click Settings.

  4. Click Delete.

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


Didn't find what you were looking for?