This documentation supports the 21.05 version of Action Request System.
To view an earlier version, select the version from the Product version menu.

Building and deploying packages by using the CLI

In addition to using BMC Remedy Deployment Management console, you can use a command-line interface (CLI) to promote data and definitions across development, QA, and production environments. 

You can perform multiple command-line operations such as Build, Import, Export, Deploy, Stop on error, Rollback, and Rollback single step. If you have package-level or content-level precheck qualification defined, these prechecks also work from the CLI.

Advantages of using CLI to manage a package 

  • The AR System Administrator can push a package to all servers using a single command. This reduces the efforts required to manually upgrade all servers to the latest package.
  • An administrator or a package deployer can trigger package deployment across environments. This saves time for manual deployment and increases the frequency of deployments.
  • A Package Creator and an administrator can automatically build an application package. This saves time and automates the build to test the toolchain.

Using CLI 

When you use a CLI to manage a package, BMC Remedy Deployment Application permission model is applicable. For information about roles and permissions, see Remedy Deployment Application roles and permissions.

Use the following files to run the commands to deploy, import, export, stop on error, or rollback a package:

  • (Windowsard2putil.bat
  • (UNIX ard2putil.sh

These files are located in the <AR_Install_Dir>/ARSystem/pluginsvr directory.

The command syntax is as follows:

ard2putil.bat -x <serverName> -u <userName>  -p <password> [-a authString] [-portnum <TCPPort>]  [-k packageName]  [-v packageVersion] [-m packageOperations] [-f filename ]

Before you begin

Make sure that in the deployConfig.properties file, the value of the filedeployer.localDeploymentRequired  parameter is set to false.
The deployConfig.properties file is located in the following folder:

  • (Windows/AR_Install_Dir
  • (UNIX/ARSystem/bin

The following table describes the details about the commands:

CommandDescriptionFormatExample
HelpProvides syntax for the requested command.

help <operation name>

help deploy

ListDisplays the available packages on the server. It also displays the Version and State information about the package. 

ard2putil.bat -x <serverName> -u <userName> -p <password> [-portnum 0] -m "list"

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "list"
ImportImports a package from the file location on the server that you have specified in the command.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "import"
-f <packageLocation>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "import" -f "C:\D2P_Packages\CustomPackage_1.zip"
BuildBuilds an existing package. The package must be in the Draft state. If the package is not in the Draft state, the operation aborts with the following message:
Package which are in draft state can be built only. The package <packageName> with version <packageVersion> is not in draft state.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "build"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "build" -k "PackageToBuild" - v "1"
Deploy

Deploys a package with a version specified. The package is deployed on the server that you have specified in the command.

The package must be in the Ready To Deploy state. The following error message is displayed if the package is not in the Ready To Deploy state:

Package which are in Deployable state can be exported only. The packge <PackageName> with version <version> is not in Deployable state.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "deploy"
-k <packageName> -v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "deploy" -k "PackageToDeploy" - v "1"
Export

Exports a package that is in the Ready To Deploy or Deployed state.

The following error message is displayed if the package is not in the Ready To Deploy or Deployed state:

Package which are in Deployable state can be exported only. The package <PackageName> with version <version> is not in Deployable state.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "export"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "export" -k "PackageToDeploy" - v "1"
Deploy with stop on error

Stops the package deployment immediately after an error occurs.

You can fix the issue occurred during the deployment and resume the deployment from the failed step.

ard2putil.bat -u <userName> -x <serverName> -p <password>
[-portnum 0] -k <packageName> -f <packageLocation> -m "deploywithstoponerror"
-v <packageVersion>
ard2putil.bat -u Demo -x "localhost" -p "" -portnum 0  -k "PackageToDeploy" -f "C:\D2P_Packages\CustomPackage_1.zip" -m "deploywithstoponerror" - v "1"
Rollback

Triggers rollback for the package that you specify in the command.

You can trigger rollback only for the packages that are in the Deployed or Deployed with Errors state. The following error message is displayed if the package is not in the Deployed or Deployed with Errors state:

Package which are in 'Deployed/Deployed With Errors' can be rollback only. The package <packageName> with version <packageVersion> is in <currentState>

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "rollback"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "rollback" -k "PackageToRollback" - v "1"

Rollback Single Step

Triggers rollback for the package to the failed step.

You can trigger rollback only for the packages that are in the Deployed or Deployed with Errors state.

ard2putil.bat -u <userName> -x <serverName> -p <password>
[-portnum 0] -k <packageName> -m "rollbacksinglestep"
-v <packageVersion>

ard2putil.bat -u Demo -x "localhost" -p "" -portnum 0 -k "PackageToRollback" -m "rollbacksinglestep" - v "1"

StatusDisplays the status of the package. It also displays the details of Status and Status Reason fields on the RDA:DeploymentPackageDetails form. 

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "status"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "status" -k "CustomPackage" -v "1"

DeletePermanently deletes a package.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "delete"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "delete" -k "CustomPackage" -v "1"
Copy

Creates a copy of the specified package. 

Important: The Copy command does not support versions earlier than AR System server 9.1.04.001.

ard2putil.bat -x <serverName>
-u <userName> -p <password>
[-portnum 0] -m "copy"
-k <packageName>
-v <packageVersion>

ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "copy" -k "CustomPackage" -v "1"

To apply a package using CLI

The AR System Administrator or a Package Deployer can use CLI to apply a package provided by BMC. Perform the following steps to apply a package:

  1. Open a command prompt.
  2. Navigate to the <AR_Install_Dir>/ARSystem/pluginsvr directory.
  3. Run the following command based on the operating system you are using:
    • (Windowsard2putil.bat
    • (UNIXard2putil.sh
  4. Import the package by using the Import command as follows: 
    ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "import" -f "C:\D2P_Packages\<fileName>.zip"
    For example:
    ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "import" -f "C:\D2P_Packages\ITSM1808_01.zip"
  5. Deploy the package by using the Deploy command as follows:
    ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m "deploy" -k "<fileName>.zip" -v "1"
    For example:
    ard2putil.bat -x "localhost" -u Demo -p "" -portnum 0  -m  "deploy" -k "ITSM1808_01.zip" -v "1"

You can view the status of the package on AR System Deployment Management Console. For more information, Accessing the AR System Deployment Management console.The ard2pplugin.log file is created in the <AR_Install_Dir>/Arserver/Db directory. You can use this log file for troubleshooting.

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

Comments