Using Octopus Deploy you can download Stackify's Retrace API Template from the Community Step Templates library. Once this is accomplished you can set up the parameters necessary in your deployment process and set the script to run from the Octopus Agent. Here is a step by step guide on how to do that:
- Open your Octopus Agent and Navigate to Library > Step Templates.
- Search for the Stackify's Retrace Deployment Script Step Template and click Install.
- Now Navigate to Projects > > Process
- Click Add Step in the upper left hand corner and select Stackify's Retrace API Template from the list.
- For your execution plan choose Octopus Server. This will ensure that the powershell script is ran from a Windows host and that it is only run once.
- Add your Retrace Parameters to our Step Template. Required fields are ApiKey, AppName, Environment, Version, and Action. See the next section for details on how to set up the Stackify.ApiKey variable for Octopus Deploy.
The Action chosen will determine what message is sent to our API. Click here for more information.
For Run Conditions select "Always Run". We have logic built into the script to automatically send a Cancel request to the API if the deployment fails.
Using Octopus Parameters with Stackify's Retrace API Template
You will notice that Stackify's Retrace API Template has default values automatically filled in for your convenience. To learn more about System Octopus Parameters click here. The Stackify.ApiKey is a custom variable that will require you to set up a Variable set in your Octopus library. This will remove the need to paste your Stackify Api Key into every new step that uses our Template. Here is how to create the Variable set:
- Navigate to Library > Variable Sets in the Octopus Deploy app. Click "Add New Variable Set"
- Name this set Stackify and click save.
- In the Name field type Stackify.ApiKey. For the Value field paste in your API key from your Retrace Account.
- Now click "Add To List" and then click "Save". Now you have a Variable Set that can be implemented into any of your Octopus Projects.
- Next go to Projects > > Variables > Library Sets.
- Click "Include Library Variable Sets" and check the Stackify box then hit save.
The Finish step example is the standard for notifying Retrace of your deployment. This will provide the majority of the desired functionality for your deployments. The Start/Finish example is for more complex scenarios where the time spent in your deployment is an important number. Keep in mind when using the Start/Finish example that if you cancel a deployment after the Start step has ran you will have to Cancel the call to the API by using the Retrace UI in Deployment Requests.
Using Start and Finish
Note: When using Stackify's Retrace API template multiple times the given Parameters must be the same across both templates.