Step templates are the reusable building blocks of deployment projects in Jaws Deploy. Each project step is based on a template, which defines both its purpose (e.g., run a script, deploy a package) and its UI configuration model. Templates allow you to standardize deployment logic across multiple projects, reducing duplication and ensuring consistency.
Jaws Deploy comes with a few pre-defined step templates useful in typical deployment scenarios. We are actively working on an open-source step template library, which can be used by all Jaws Deploy installations (cloud and on-prem). The library will also be open for community-authored templates. Stay tuned.
By using step templates, you can:
When you add a new project step in Jaws Deploy, you select a template as its base. The template specifies:
This separation means that templates are both user-friendly (providing configurable UI to end users) and highly extensible (thanks to JSON definition for the UI and code for logic).
When setting up steps in a project you'll notice that all steps share some common configuration - names, descriptions, filtering by Environments, Tags or Machines, is the step allowed to run in parallel (on multiple Machines at once) and others. Below the common sections there will be more options which were defined in the step JSON UI configuration.
All inputs in the step configuration support variables. This means you can wrap common deployment logic into step templates, expose some parts of the step logic as custom UI inputs, and then apply variables to them, which makes step templates one of Jaws superpowers - reusable building blocks, driven by variables, which resolve automatically depending on the deployment context.
To get more familiar with how step templates work let's create a simple step template from scratch, create a project step based on it, run it and observe the results.
/w/main
).{}
icon next to step template name to view the script baked into this template. This can be helpful in future to preview the logic related with a step template.Write-Host "Hello world!"
// here we read the value from step configuration as specified in UI
$variableNameToPrint = $Jaws.Parameters["STEP.VariableNameToPrint"].Value
// now we read the value of a variable from deployment context, based on the variable name ...
$variableValue = $Jaws.Parameters["VAR.$variableNameToPrint"].Value
// ... and print the variable value to the deployment log
Write-Host "The variable value is: $variableValue"
[
{
"Id": "VariableNameToPrint",
"Name": "Name of the variable to print",
"Description": "Specify a name of a variable that exists in the deployment context - this step template will print it out to deployment log.",
"ControlType": "SingleLineText"
}
]
In this guide we've shown some basics of step templates and we followed a very simple example showcasing how step templates can be utilized. To dive deeper into step templates refer to other existing step templates in the "Step templates" area available in the app's left menu. By examining the code you can get a deeper understanding, learn how you can wrap logic in functions, how to access variables from the deployment context and much more.
Step templates give you full control over what Jaws Deploy can do during a deployment. Since you have access to PowerShell which runs directly on the deployment target or a worker machine (which e.g. canperform deployment tasks against some cloud entities) - the possibilities of step templates are pretty much unlimited. 🚀