DeployJob - createDeployJob_1

DeployJob - createDeployJob

Description :

This command creates an advanced Deploy Job for a BLPackage. Advanced Deploy Jobs provide greater flexibility than basic Deploy Jobs. Advanced Deploy Jobs let you schedule phases individually, control the flow of the job by server or phase, and manage the job's state after it executes by retrying or undoing the job. See a similar command, createDeployJob , to create a basic Deploy Job. Also, see the command createDeployJob to create an advanced Deploy Job with various job options.

The argument groupId is the ID of the parent depot group containing the Deploy Job. Use a command like groupNameToId to determine this ID. The group ID used must be a job group, otherwise a group not found error will occur.

The argument packageKey provides the handle to the BLPackage to be deployed. Use the command getDBKeyByGroupAndName to get this handle.

The other arguments correspond to choices you can make when defining a Deploy Job in Configuration Manager. Note that for a basic Deploy Job, the values of isStagingAfterSimulate and isCommitAfterStaging should be false while for an advanced Deploy Job, these values are typically set to true. In addition, for a basic Deploy Job, isResetOnFailure should be set to true while for an advanced Deploy Job, isResetOnFailure can be either true or false.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

deployJobName

String

Name assigned to this Deploy Job.

groupId

Integer

ID of the job group where this jobs is saved.

packageKey

DBKey

Handle associated with the BLPackage for this Deploy Job.

deployType

Integer

Specifies whether this is a basic (0) or advanced (1) Deploy Job.

serverName

String

Server where you want to run this job.

isSimulateEnabled

Boolean

True indicates the job should include a Simulate phase, during which a dry run is performed without actually deploying the package.

isCommitEnabled

Boolean

True indicates the job should include a Commit phase, during which the package is actually applied to the target server.

isStagedIndirect

Boolean

True indicates the package is delivered to a server functioning as a repeater. During the Commit phase, the package is actually applied to the target server.

logLevel

Integer

Specifies the level of logging to display for the job (0 - ERROR_ONLY, 1 - ERROR_AND_WARNING, 2 - ALL_INFO)

isExecuteByPhase

Boolean

True indicates the flow of the job should be controlled by phase; false indicates the flow is controlled by server. This argument should be set to false for a basic Deploy Job.

isResetOnFailure

Boolean

True indicates the job is automatically reset on failure. This argument should be set to true for a basic Deploy Job.

isRollbackAllowed

Boolean

True indicates that rollback files are left on the target for later use.

isRollbackOnFailure

Boolean

True indicates the job should automatically roll back on failure.

isRebootIfRequired

Boolean

True indicates the server should automatically reboot if necessary.

isCopyLockedFilesAfterReboot

Boolean

True indicates locked files are copied after reboot; false indicates locked files are treated as errors.

isStagingAfterSimulate

Boolean

True indicates staging should start immediately after the Simulate phase is complete. Set this value to false for a basic Deploy Job. For an advanced Deploy Job, this value is typically set to true.

isCommitAfterStaging

Boolean

True indicates the Commit phase should start immediately after staging is complete. This value should be set to false for a basic Deploy Job. For an advanced Deploy Job, this value is typically set to true.

Example

In the following example, an advanced Deploy Job includes a Simulate phase, which runs first, followed by a Commit phase. This job specifies a server group as its target.

Script


# 

# script constants 

#deploy type 

ADVANCED=1 

BASIC=0 

#logging level 

ERROR_ONLY=0 

ERROR_AND_WARNING=1 

ALL_INFO=2 




JOB_GROUP_NAME=/deploys 

TARGET_SERVER=scavmnode30 

TARGET_GROUP="/east/windows servers" 

DEPLOY_JOB_NAME="deploy base files" 


DEPLOY_TYPE=$ADVANCED 


SIMULATE=true 

COMMIT=true 

INDIRECT=false 


LOG_LEVEL=$ERROR_AND_WARNING 

EXECUTE_BY_PHASE=true 

RESET_ON_FAILURE=false 

ALLOW_ROLLBACK=true 

ROLLBACK_ON_FAILURE=true 

REBOOT_IF_REQUIRED=true 

COPY_LOCKED_FILES=true 

STAGE_AFTER_SIMULATE=true 

COMMIT_AFTER_STAGE=true 


BASIC_DEPLOY_OPTS="$SIMULATE $COMMIT $INDIRECT" 

ADVANCED_OPTS="$LOG_LEVEL" 

ADVANCED_OPTS="${ADVANCED_OPTS} $EXECUTE_BY_PHASE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $RESET_ON_FAILURE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $ALLOW_ROLLBACK" 

ADVANCED_OPTS="${ADVANCED_OPTS} $ROLLBACK_ON_FAILURE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $REBOOT_IF_REQUIRED" 

ADVANCED_OPTS="${ADVANCED_OPTS} $COPY_LOCKED_FILES" 

ADVANCED_OPTS="${ADVANCED_OPTS} $STAGE_AFTER_SIMULATE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $COMMIT_AFTER_STAGE" 


DEPLOY_OPTS="${BASIC_DEPLOY_OPTS} ${ADVANCED_OPTS}" 


PACKAGE_KEY=`blcli BlPackage  [getDBKeyByGroupAndName|DeployJob - getDBKeyByGroupAndName] /basefiles "base files"` 

GROUP_ID=`blcli JobGroup  [groupNameToId|JobGroup - groupNameToId] "${JOB_GROUP_NAME}"` 

DEPLOY_JOB_KEY=`blcli DeployJob  [createDeployJob|DeployJob - createDeployJob_1] "${DEPLOY_JOB_NAME}" $GROUP_ID $PACKAGE_KEY $DEPLOY_TYPE $TARGET_SERVER $DEPLOY_OPTS` 

DEPLOY_JOB_KEY=`blcli Job  [addTargetGroup|Job - addTargetGroup] $DEPLOY_JOB_KEY "${TARGET_GROUP}"` 



Was this page helpful? Yes No Submitting... Thank you

Comments