Use predefined steps in rules
Deploy rules enable you to use XML or Jython to specify the steps that belong in a deployment plan and how the steps are configured. Several Deploy plugins include predefined rules that you can use when writing rules. For more information on rules, see Get started with rules.
Predefined steps in standard plugins
The standard Deploy plugins contain the following predefined steps:
create-ci
: Creates a configuration item (CI) in the Deploy Repository.delete-ci
: Deletes a CI from the Deploy Repository.delete
: Deletes a file or directory on a remote host.jython
: Executes a Python script locally on the Deploy server.manual
: Use to incorporate a manual process as part of a deployment.noop
: A "dummy" step that does not perform any actions.os-script
: Executes a script on a remote host.powershell
: Executes a PowerShell script on the remote Microsoft Windows host.template
: Generates a file based on a FreeMarker template and uploads the file to a remote host.upload
: Copies audm.Artifact
to anoverthere.Host
.wait
: Freezes the deployment plan execution for a specified number of seconds.
For information about step parameters and examples, see Step reference.
Predefined steps in other plugins
Other Deploy plugins can contain predefined steps, for example, the IBM WebSphere Application Server (WAS) plugin contains a wsadmin
step that can execute a Python script via the Python terminal of a was.Cell
.
For information about predefined steps that are included with other Deploy plugins, see Plugins and integrations for the plugin that you are interested in.
Calculated step parameters
For some predefined steps, Deploy calculates the values of parameters so you do not have to specify them, this includes parameters that are required.
Order of a step
The order
parameter of a step is calculated as follows:
- If the scope is
pre-plan
,post-plan
, orplan
, theorder
is 50. - If the scope is
deployed
and:- The operation is
CREATE
,MODIFY
, orNOOP
and:- The deployed is a
udm.Artifact
CI, theorder
is 70. - The deployed is not a
udm.Artifact
CI, theorder
is 60.
- The deployed is a
- The operation is
DESTROY
and:- The deployed is a
udm.Artifact
CI, theorder
is 30. - The deployed is not a
udm.Artifact
CI, theorder
is 40.
- The deployed is a
- The operation is
For more information, see Steps and steplists in Deploy.
Description of a step
The description
parameter of a step is calculated as follows:
- If the scope is
deployed
, thedescription
is calculated based on theoperation
, the name of thedeployed
, and the name of thecontainer
. - If the scope is not
deployed
, thedescription
cannot be calculated automatically and must be specified manually.
Target host
The target-host
parameter of a step is calculated as follows:
- If the scope is
deployed
and:deployed.container
is of typeoverthere.Host
, thetarget-host
is set todeployed.container
.deployed.container
is of typeoverthere.HostContainer
, thetarget-host
is set todeployed.container.host
.deployed.container
has a property calledhost
, the value of which is of typeoverthere.Host
, thentarget-host
is set to this value.
- In other cases,
target-host
cannot be calculated automatically and must be specified manually.
For more information about overthere
CIs, see Remoting Plugin Reference.
Artifact
The artifact
parameter of a step is calculated as follows:
- If the scope is
deployed
anddeployed
is of typeudm.Artifact
, theartifact
is set todeployed
. - In other cases,
artifact
cannot be calculated automatically and must be specified manually.
Contexts
Some steps have contexts such as freemarker-context
, jython-context
or powershell-context
.
The context of a step is enriched with calculated variables as follows:
- If the scope is
deployed
, the context is enriched with a deployed instance that is accessible in a FreeMarker template by namedeployed
. - If the scope is
deployed
, the context is enriched with a previousDeployed instance that is accessible in a FreeMarker template by namepreviousDeployed
. - In other cases, the context is not calculated automatically.
Note: Depending on the operation, the deployed
or previousDeployed
might not be initialized. For example, if the operation is CREATE
, the deployed
is set, but previousDeployed
is not set.
Note: You can override the default deployed
or previousDeployed
values by explicitly defining a FreeMarker context.
For example:
<freemarker-context>
<previousDeployed>example</previousDeployed>
</freemarker-context>
Create a custom step
If the predefined step types in Deploy do not provide the functionality that you need, you can define custom step types and create rules that refer to them. For more information, see Create a custom step for rules.