3 Replies Latest reply on May 13, 2010 12:18 PM by Bill Robinson

    Commit options in a deploy job via blcli

    Naveen Anne

      One of the client I am working with has a requirement to set the commit options in a deploy job via blcli. Specifically the following two:

      1. Overwrite Read-only files

      2. Register COM components

       

      By default, all deploy jobs we create (via blcli or the GUI) have the 'Register COM components' checked and 'Overwrite Read only files' unchecked.

       

      The requirement is to create deploy jobs via automated process (read blcli calls) without any use of CM. I looked through existing blcli calls and "DeployJob createDeployJob" command doesn't provide me an option to set these values. Is there anyway to either change the defaults for these values for all deploy jobs (read ~400 deploy jobs per day) or is there a blcli call I am missing?

       

      BL Version is 7.6

       

      Thanks

       

       

       

        • 1. Re: Commit options in a deploy job via blcli
          Bill Robinson

          You can set this globally in the property dictionary for all jobs being created. 

           

          Otherwise look in the unreleased commands.

          • 2. Re: Commit options in a deploy job via blcli
            Naveen Anne

            In the unreleased commands, I found two commands under DeployJob name space that could prove useful:

             

            Command Name : setOverwriteReadOnlyFiles

            Name space : DeployJob

            Command Type : API

            Release command : false

            Description :

             

            Return type : void

            Command Input :

            Variable NameVariable TypeDescription
            bBooleanno description

             

             

             

            Command Name : setRegComComponents

            Name space : DeployJob

            Command Type : API

            Release command : false

            Description :

             

            Return type : void

            Command Input :

            Variable NameVariable TypeDescription
            bRegBooleanno description

             

             

            I do not understand the command input to the above commands. What boolean value should I supply? Normally, I would expect to supply either the job key or job name.

             

            Thanks

            • 3. Re: Commit options in a deploy job via blcli
              Bill Robinson

              drop the text below (sorry, can't attach files) into <install dir>/br/xml/cli/DeployJob-PS-1.xml on the appserver(s) or whatever will run the command.

               

               

              It takes all of the same options as the 4th DeployJob createDeployJob command listed in the blcli docs, but w/ two additional, overwritereadonlyfiles and regcomcomponents - both true/false.

               

              so you would call it like:

               

              blcli DeployJob createDeployJob $deployJobName$ $groupId$ $packageKey$ $deployType$ $serverName$ $isSimulateEnabled$ $isCommitEnabled$ $isStagedIndirect$ $logLevel$ $isExecuteByPhase$ $isResetOnFailure$ $isRollbackAllowed$ $isRollbackOnFailure$ $isRebootIfRequired$ $isCopyLockedFilesAfterReboot$ $isStagingAfterSimulate$ $isCommitAfterStaging$ false $isSingleDeployModeEnabled$ $isSUMEnabled$ $singleUserMode$ $rebootMode$ $isMaxWaitTimeEnabled$ $maxWaitTime$ $isMaxAgentConnectionTimeEnabled$ $maxAgentConnectionTime$ $isFollowSymlinks$ $useReconfigRebootAtEndOfJob$ $overrideItemReconfigReboot$ $overwritereadonlyfiles$ $regcomcomponents$

               

              I'm assuming you replace the $var$ w/ the actual value you want to pass in that line above

               

              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE command_inventory SYSTEM "file://bladelogic.com/dtds/Command-Inventory.dtd">

              <command_inventory>

              <name_space name="DeployJob">

              <complex_command command_id="createDeployJob-DEFAULT-0001" published="yes" release="yes">

              <name>createDeployJob</name>

              <description/>

              <argument_list>

              <argument desc="No description available" name="deployJobName">java.lang.String</argument>

              <argument desc="No description available" name="groupId">int</argument>

              <argument desc="No description available" name="objectKey">com.bladelogic.model.base.keys.DBKey</argument>

              <argument desc="No description available" name="deployType">int</argument>

              <argument desc="No description available" name="serverName">java.lang.String</argument>

              <argument desc="No description available" name="isSimulateEnabled">boolean</argument>

              <argument desc="No description available" name="isCommitEnabled">boolean</argument>

              <argument desc="No description available" name="isStagedIndirect">boolean</argument>

              <argument desc="No description available" name="logLevel">int</argument>

              <argument desc="No description available" name="isExecuteByPhase">boolean</argument>

              <argument desc="No description available" name="isResetOnFailure">boolean</argument>

              <argument desc="No description available" name="isRollbackAllowed">boolean</argument>

              <argument desc="No description available" name="isRollbackOnFailure">boolean</argument>

              <argument desc="No description available" name="isAllowReboot">boolean</argument>

              <argument desc="No description available" name="isCopyLockedFiles">boolean</argument>

              <argument desc="No description available" name="isStagingAfterSimulate">boolean</argument>

              <argument desc="No description available" name="isCommitAfterStaging">boolean</argument>

              <argument desc="No description available" name="isSingleDeployModeEnabled">boolean</argument>

              <argument desc="No description available" name="isSUMEnabled">boolean</argument>

              <argument desc="No description available" name="singleUserMode">int</argument>

              <argument desc="No description available" name="rebootMode">int</argument>

              <argument desc="No description available" name="isMaxWaitTimeEnabled">boolean</argument>

              <argument desc="No description available" name="maxWaitTime">java.lang.String</argument>

              <argument desc="No description available" name="isMaxAgentConnectionTimeEnabled">boolean</argument>

              <argument desc="No description available" name="maxAgentConnectionTime">int</argument>

              <argument desc="No description available" name="isFollowSymlinks">boolean</argument>

              <argument desc="No description available" name="useReconfigRebootAtEndOfJob">boolean</argument>

              <argument desc="No description available" name="overrideItemReconfigReboot">int</argument>

              <argument desc="Overwrite ro files" name="overwritereadonlyfiles">boolean</argument>

              <argument desc="register com components" name="regcomcomponents">boolean</argument>

              </argument_list>

              <commands_to_execute>

              <command_invocation>

              <namespace_ref>Server</namespace_ref>

              <name>getServerDBKeyByName</name>

              <input>$serverName$</input>

              <store_result>

              <name>serverKey</name>

              </store_result>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Utility</namespace_ref>

              <name>createModelObject</name>

              <input>DeployJob</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>setName</name>

              <input>$deployJobName$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>setGroupId</name>

              <input>$groupId$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Utility</namespace_ref>

              <name>convertModelType</name>

              <input>BLPACKAGE</input>

              <store_result>

              <name>modelTypeId</name>

              </store_result>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>addDepotObjectKey</name>

              <input>$objectKey$ NAMED_OBJECT=modelTypeId</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setDeployType</name>

              <input>$deployType$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>addSJobDevice</name>

              <input>NAMED_OBJECT=serverKey</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setSimulateEnabled</name>

              <input>$isSimulateEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setCommitEnabled</name>

              <input>$isCommitEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setStagingIndirect</name>

              <input>$isStagedIndirect$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setLogLevel</name>

              <input>$logLevel$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setExecuteByPhase</name>

              <input>$isExecuteByPhase$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setResetOnFailure</name>

              <input>$isResetOnFailure$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setRollbackAllowed</name>

              <input>$isRollbackAllowed$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setRollbackOnFailure</name>

              <input>$isRollbackOnFailure$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setAllowReboot</name>

              <input>$isAllowReboot$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setStagingAfterSimulate</name>

              <input>$isStagingAfterSimulate$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setCommitAfterStaging</name>

              <input>$isCommitAfterStaging$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setCopyLockedFiles</name>

              <input>$isCopyLockedFiles$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setSoftwareJob</name>

              <input>false</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setSingleDeployMode</name>

              <input>$isSingleDeployModeEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setSingleUserMode</name>

              <input>$isSUMEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setSingleUserModeSetting</name>

              <input>$singleUserMode$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setRebootSetting</name>

              <input>$rebootMode$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setUseMaxWaitTime</name>

              <input>$isMaxWaitTimeEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setMaxWaitTime</name>

              <input>$maxWaitTime$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setUseConnectionTimeout</name>

              <input>$isMaxAgentConnectionTimeEnabled$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setConnectionTimeout</name>

              <input>$maxAgentConnectionTime$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setFollowSymlinks</name>

              <input>$isFollowSymlinks$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setReconfigureRebootJobSetting</name>

              <input>$useReconfigRebootAtEndOfJob$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setItemReconfigureRebootModeSetting</name>

              <input>$overrideItemReconfigReboot$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setOverwriteReadOnlyFiles</name>

              <input>$overwritereadonlyfiles$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>DeployJob</namespace_ref>

              <name>setRegComComponents</name>

              <input>$regcomcomponents$</input>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>create</name>

              <input/>

              </command_invocation>

              <command_invocation>

              <namespace_ref>Job</namespace_ref>

              <name>getDBKey</name>

              <input/>

              </command_invocation>

              </commands_to_execute>

              </complex_command>

              </name_space>

              </command_inventory>