DeployJob - undoDeployWithApproval_1
DeployJob - undoDeployWithApproval
Description :
This command performs an undo (that is, a rollback) of a successful Deploy Job on a given target server after approval. For an undo to succeed, rollback must have been enabled on the job when it was originally executed. This command first finds the latest job run where this target server was used, and then rolls back this job run. The execution of the job starts only after approval.
The argument deployJobKey is the handle to the Deploy Job you want to undo. To find the jobKey, use the getDBKeyByGroupAndName command.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
deployJobKey | DBKey | Handle to the Deploy Job you want to undo. |
serverName | String | Name of the target server where the Deploy Job ran. |
approvalId | Integer | Approval ID to be attached to the job. |
Example
The following example performs an undo of a Deploy Job on server engwin2k3agt1. The Deploy Job in this example has a name of deployconfig, and resides in job group /deploys.
Script
JOB_KEY=`blcli DeployJob [getDBKeyByGroupAndName|DeployJob - getDBKeyByGroupAndName] /deploys deployconfig`
JOB_APPROVAL_ID=`blcli Job createApproval 2 2 "My change" 2 3 "" ""`
DeployJob undoDeploy $JOB_KEY "engwin2k3agt1" $JOB_APPROVAL_ID