DeployJob - createSoftwareDeployJob_2

DeployJob - createSoftwareDeployJob

Description :

This command creates an advanced Software Deploy Job. Advanced Software Deploy Jobs provide greater flexibility than basic Deploy Jobs. See a similar command, createSoftwareDeployJob , to create a basic Software Deploy Job.

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 objectKey provides the handle to the BLPackage to be deployed. Use the command getDBKeyByTypeStringGroupAndName to get this handle.

The argument modelType provides the type of software to be deployed. The following is a list of software installables that are valid depot objects:

  • AIX_PATCH_INSTALLABLE: AIX patch
  • AIX_PACKAGE_INSTALLABLE: AIX package
  • HP_PRODUCT_INSTALLABLE: HP-UX product
  • HP_BUNDLE_INSTALLABLE: HP-UX bundle
  • HP_PATCH_INSTALLABLE: HP-UX patch
  • RPM_INSTALLABLE: Linux RPM
  • DEBIAN_PACKAGE_INSTALLABLE: Debian Package
  • SOLARIS_PATCH_INSTALLABLE: Solaris patch
  • SOLARIS_PACKAGE_INSTALLABLE: Solaris package
  • HOTFIX_WINDOWS_INSTALLABLE: Windows HotFix
  • SERVICEPACK_WINDOWS_INSTALLABLE: Windows Service Pack
  • MSI_WINDOWS_INSTALLABLE: Windows MSI Package
  • INSTALLSHIELD_WINDOWS_INSTALLABLE: Windows InstallShield Package

The argument singleUserMode specifies the user mode option and it accepts one of the following values:

  • 0: Use item defined user mode setting
  • 1: Ignore item defined user mode setting
  • 2: Use single-user mode without reboot
  • 3: Reboot into single-user mode
    The singleUserMode argument is valid on UNIX-style systems only. In addition, the argument isSUMEnabled has to be true for it to take effect.

The argument rebootMode specifies the reboot option and it accepts one of the following values:

  • 0 - Use item defined reboot setting
  • 1 - Ignore item defined reboot setting
  • 2 - Reboot at end of job

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

deployJobName

String

Name of this Deploy Job.

groupId

Integer

ID of the job group where this job is saved.

objectKey

DBKey

Handle to the software object for this Deploy Job.

modelType

String

The type of software being deployed.

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)

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 that locked files are copied after reboot; false indicates that locked files are treated as errors.

isSingleDeployModeEnabled

Boolean

True indicates the job should run in single deploy mode.

isSUMEnabled

Boolean

True indicates that single user mode is enabled, false otherwise.

singleUserMode

Integer

The setting of the single user mode.

rebootMode

Integer

The reboot options.

isMaxWaitTimeEnabled

Boolean

True indicates the Max. Wait Time in Deploy Queue option is enabled.

maxWaitTime

String

How long a job can wait in the deploy queue before it is declared failed. Expressed in seconds. Default is 30. This variable takes effect only when isMaxWaitTimeEnabled is set to true.

isMaxAgentConnectionTimeEnabled

Boolean

True indicates the Max. Agent Connection Time option is enabled. Default is false.

maxAgentConnectionTime

Integer

The maximum time (in seconds) to try to establish a connection to an agent. This variable takes effect only if isMaxAgentConnectionTimeEnabled is set to true. Default is 60.

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 

#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" 


SOFTWARE_TYPE=HOTFIX_WINDOWS_INSTALLABLE 


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 

SINGLE_DEPLOY_MODE=true 

ENABLE_SINGLE_USER_MODE=true 

SINGLE_USER_MODE=3 

REBOOT_MODE=2 

ENABLE_DEPLOY_QUEUE_TIME_OUT=true 

DEPLOY_QUEUE_TIME_OUT=30 

ENABLE_AGENT_CONN_TIME_OUT=true 

AGENT_CONN_TIME_OUT=60 


BASIC_DEPLOY_OPTS="$SIMULATE $COMMIT $INDIRECT" 

ADVANCED_OPTS="$LOG_LEVEL" 

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} $SINGLE_DEPLOY_MODE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_SINGLE_USER_MODE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $SINGLE_USER_MODE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $REBOOT_MODE" 

ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_DEPLOY_QUEUE_TIME_OUT" 

ADVANCED_OPTS="${ADVANCED_OPTS} $DEPLOY_QUEUE_TIME_OUT" 

ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_AGENT_CONN_TIME_OUT" 

ADVANCED_OPTS="${ADVANCED_OPTS} $AGENT_CONN_TIME_OUT" 


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


SOFTWARE_KEY=`blcli DepotObject  [getDBKeyByTypeStringGroupAndName|DepotObject - getDBKeyByTypeStringGroupAndName] $SOFTWARE_TYPE /Depot "WindowsXP-KB920683.exe"` 

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

DEPLOY_JOB_KEY=`blcli DeployJob  [createSoftwareDeployJob|DeployJob - createSoftwareDeployJob_1] "${DEPLOY_JOB_NAME}" $GROUP_ID $SOFTWARE_KEY $SOFTWARE_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