In this section:

Target audience:

  • CAST administrators
  • Delivery Managers
Summary: This section of documentation provides an explanation of how to deliver source code in an automated and repeatable way.

Introduction

Prerequisites

Before you can starting using the CLI, you must ensure that you meet the following requirements:

(tick)All Delivery Managers must be working in CAST AIC Portal mode (i.e. using the DMT as a standalone tool installed from the CAST AIC Portal). If you are working with the CAST Delivery Manager Tool launched directly from the CAST Management Studio, you should use the CAST Management Studio CLI  instead.
(tick)All Delivery Managers must have already Delivered and Closed one Version (including Packages) using the CAST Delivery Manager Tool GUI interface installed from the CAST AIC Portal and have that Application and Version in their local cache of the DMT data - this is because the aim of the command line is to automate the delivery of a Version "n+1" and all its Packages - i.e. you can automate this process via the command line when your source code has changed and you do not need to add additional packages, however, the Version "n" must exist already.

Supported Operating Systems

The CAST Delivery Manager Tool GUI can be used in both Windows and Linux Operating System environments - see Supported Platforms. The same is true of the CAST Delivery Manager Tool CLI. The instructions provided in this document are provided only for Windows Operating Systems, therefore you will need to adapt the batch scripts to Linux.

In a Linux environment:

Usage scenarios

The DMT command line utility is designed for the following scenarios, ONLY:

If your environment uses a web proxy to control or improve performance of internet or intranet access, please see Notes for using the CAST Delivery Manager Tool CLI via a web proxy.

How does it work?

In CAST AIC Portal mode, the CAST Delivery Manager Tool is launched from the CAST AIC Portal using the Java Network Launch Protocol (JNLP). The same is true for the command line utility and as such, you must use batch files containing the required instructions to run your operations. For each of the scenarios described above in Usage scenarios, a batch file requires certain common configuration parameters, and then parameters that are specific to each action. These are explained below.

Please note that when launching the CAST Delivery Manager Tool using the CLI mode for the first time, you may be prompted that the application represents a security risk - which can hinder command line operations. Please do the following to prevent this dialog box displaying again in subsequent command line operations:

  • Tick the "Do not show this again..." option
  • Click Run.

Required common batch file parameters

Each batch file you create requires the following common parameters to launch the CAST Delivery Manager Tool in command line mode - you should modify them all (except the JNLP_FILE parameter) and match them to your local environment:

Windows

REM ===============================================
REM = DMT - Configuration
REM = Please do not change the JNLP_FILE parameter
REM ===============================================

set AICPORTAL_HOST=<name of machine hosting CAST AIC Portal - see below>
set AICPORTAL_PORT=<port used by the application server hosting the CAST AIC Portal, e.g.: 8080>
set AICPORTAL_WEBAPP=<Name of the CAST AIC Portal web application, e.g.: CAST-AICPortal>
set APPLICATION_ID=<Application ID - this can be found in the DMT in the Application screen and will consists of a string of random characters and letters - see below>
set AUTH=<The DMT requires authentication with CAST AIC Portal credentials prior to launch - see below for format>
set JNLP_FILE=http://%AICPORTAL_HOST%:%AICPORTAL_PORT%/%AICPORTAL_WEBAPP%/%APPLICATION_ID%/dmt-launcher.jnlp?url=http%%3A%%2F%%2F%AICPORTAL_HOST%%%3A%AICPORTAL_PORT%%%2F%AICPORTAL_WEBAPP%

Linux

AICPORTAL_HOST=<name of machine hosting CAST AIC Portal - see below>
AICPORTAL_PORT=<port used by the application server hosting the CAST AIC Portal, e.g.: 8080>
AICPORTAL_WEBAPP=<Name of the CAST AIC Portal web application, e.g.: CAST-AICPortal>
APPLICATION_ID=<Application ID - this can be found in the DMT in the Application screen and will consists of a string of random characters and letters - see below>
AUTH=<The DMT requires authentication with CAST AIC Portal credentials prior to launch - see below for format>
JNLP_FILE=http://$AICPORTAL_HOST:$AICPORTAL_PORT/$AICPORTAL_WEBAPP/$APPLICATION_ID/dmt-launcher.jnlp?url=https%%3A%%2F%%2F$AICPORTAL_HOST%%3A$AICPORTAL_PORT%%2F$AICPORTAL_WEBAPP

Notes on parameters

AICPORTAL_HOST

Please note that the value used in the AICPORTAL_HOST variable is case sensitive. Ensure that you use the SAME case for the CAST AIC Portal host name as used when accessing the CAST AIC Portal in your web browser to download the GUI version of the CAST Delivery Manager Tool. This can be determined by looking at the start menu item for the GUI version of the CAST Delivery Manager Tool installed on your workstation.

For example - the host name is displayed as highlighted below:

Failure to do so will cause a second instance of the CAST Delivery Manager Tool to be downloaded when you run the batch file, and this will point to a different local workspace.

APPLICATION_ID

You can determine the APPLICATION_ID value in the CAST Delivery Manager Tool:

AUTH

The DMT requires authentication with the CAST AIC Portal credentials prior to launch - and this applies in command line mode as well as in GUI mode. Use the following format to define the credentials that you wish to use to authenticate when the command line is run - the example below shows the default "cast" username with the default "cast" password (modify this as required):

set AUTH=-username cast -password cast

This will send the username and password in clear-text - if you need to encrypt the password to improve security (highly recommended), you should instead generate an encryption key (please see Encrypting the password for the CAST Delivery Manager Tool command line for more information) for your password and use it as follows:

set AUTH=-username cast -authkey <your encrypted key>

For example:

set AUTH=-username cast -authkey u0tjM5qkCZO8IpzrD0CYUw==

If the authentication fails (incorrect username/password, or user not authorised), then the action specified in the command line will fail. If any errors occur, they will be logged in the latest CAST-jnlpInstaller.CastLog2 file created in C:\Users\<user_name>\AppData\Local\Temp, as shown by the following dialog:

Clicking OK will cause another dialog to be displayed: 


By clicking the Details button you can see the java exception stack trace:

Required Batch file parameters for one single Delivery Manager scenario

In this scenario, we have one Delivery Manager who is responsible for all source code. In this case, the Delivery Manager can run one command line batch that will automate the creation of a new version (copied from an existing version) - V2, package the same packages and deliver the Version (V2) with "close" option. The required parameters are shown below:

AutomateVersion

Example:

Windows

REM ========================================================
REM = AutomateVersion - one single Delivery Manager scenario
REM = Please only modify the path to your Java JRE "bin" folder
REM = note the quote marks that must be used for this path
REM = if it contains spaces.
REM ========================================================

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version which will be copied>
set NAME=<Name of the new Version which will be created>
set RELEASE_DATE=<Date of release of the Version, e.g., YYYYMMDDHHSS>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_AUTOMATE=AutomateVersion -application \"%APPLICATION%\" -version \"%VERSION%\" -name \"%NAME%\" -releaseDate \"%RELEASE_DATE%\" -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_AUTOMATE%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version which will be copied>
NAME=<Name of the new Version which will be created>
DATE=`date '+%Y%m%d%H%M'`
RELEASE_DATE=$DATE
LOG_FILE_PATH="log1"
ACTION_AUTOMATE="AutomateVersion -application \"$APPLICATION\" -version \"$VERSION\" -name \"$NAME\" -releaseDate $RELEASE_DATE -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_AUTOMATE"

What you should expect after running the batch

Delivery Manager Tool

V1 will be copied to create V2, the Packages will be packaged and the Version will be marked as Delivered and Closed (read-only):

CAST Management Studio

The copied version will now move to Delivery done in the CAST Management Studio:

Required Batch file parameters for multiple Delivery Manager scenario

In this scenario, we have Version V1 containing two packages that has been delivered and closed. We have two Delivery Managers:

Step 1 - DM1 (first Delivery Manager) will create a new Version

In this example, DM1 will create a new Version (V2) from V1.

AddVersion

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version which will be copied>
set NAME=<Name of the new Version which will be created>
set RELEASE_DATE=<Date of release of the Version, e.g., YYYYMMDDHHSS>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_addVersion=addVersion -application \"%APPLICATION%\" -version \"%VERSION%\" -name \"%NAME%\" -releaseDate %RELEASE_DATE% -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_addVersion%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version which will be copied>
NAME=<Name of the new Version which will be created>
DATE=`date '+%Y%m%d%H%M'`
RELEASE_DATE=$DATE
LOG_FILE_PATH="log1"
ACTION_addVersion="addVersion -application \"$APPLICATION\" -version \"$VERSION\" -name \"$NAME\" -releaseDate $RELEASE_DATE -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_addVersion"

After running this step, you should expect the following:

Delivery Manager Tool

The new Version has been created by copying the previous Version:

The Packages in the new copied Version will not yet have been Packaged:

CAST Management StudioThe copied version will not be visible in the CAST Management Studio, because a Deliver action has not yet been run.

Step 2 - DM1 (first Delivery Manager) Packages his specific source code Package

In this example, DM1 will package his database source package, because the database has changed since V1. We are using the -reset option because the source code has changed.

Generate

Example:

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version that you are working with>
set PACKAGE=<Name of the source code package to Package>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_Generate=Generate -application \"%APPLICATION%\" -version \"%VERSION%\" -package \"%PACKAGE%\" -reset -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_Generate%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version that you are working with>
PACKAGE=<Name of the source code package to Package>
LOG_FILE_PATH="log1"
ACTION_Generate="Generate -application \"$APPLICATION\" -version \"$VERSION\" -package \"$PACKAGE\" -reset -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_Generate"

After running this step, you should expect the following:

Delivery Manager Tool

DM1's Package in the new copied Version will be marked as packaged:

CAST Management StudioThe copied version will not be visible in the CAST Management Studio, because a Deliver action has not yet been run.

Step 3 - DM1 will Deliver the version to the CAST AIC Portal

In this example, DM1 will now Deliver the Version (including his package) to the CAST AIC Portal. DM2 (and other Delivery Managers if they exist) will then be able to perform a Refresh and download V2 from the CAST AIC Portal. We are NOT using the -close action because we do not want to close the Version yet.

Deliver

Example:

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version that you are Delivering>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_Deliver=Deliver -application \"%APPLICATION%\" -version \"%VERSION%\" -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_Deliver%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version that you are Delivering>
LOG_FILE_PATH="log1"
ACTION_Deliver="Deliver -application \"$APPLICATION\" -version \"$VERSION\" -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_Deliver"

After running this step, you should expect the following:

Delivery Manager ToolNo change from Step 2.
CAST Management Studio

The copied version will now be visible in the CAST Management Studio:

Step 4 - DM2 refreshes the Version (V2) that was created by DM1

Refresh

Example:

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version that you are working with>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_Refresh=Refresh -application \"%APPLICATION%\" -version \"%VERSION%\" -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_Refresh%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version that you are working with>
LOG_FILE_PATH="log1"
ACTION_Refresh="Refresh -application \"$APPLICATION\" -version \"$VERSION\" -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_Refresh"

After running this step, you should expect the following:

Delivery Manager ToolDM2 will see V2 in the Delivery Manager Tool, with the packages.
CAST Management StudioNo change from Step 3.

Step 5 - DM2 (last Delivery Manager) Packages his specific source code Package

In this example, DM2 will package his VB source package, because the code has changed since V1. We are using the -reset option because the source code has changed.

Generate

Example:

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version that you are working with>
set PACKAGE=<Name of the source code package to Package>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_Generate=Generate -application \"%APPLICATION%\" -version \"%VERSION%\" -package \"%PACKAGE%\" -reset -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_Generate%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version that you are working with>
PACKAGE=<Name of the source code package to Package>
LOG_FILE_PATH="log1"
ACTION_Generate="Generate -application \"$APPLICATION\" -version \"$VERSION\" -package \"$PACKAGE\" -reset -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_Generate"

After running this step, you should expect the following:

Delivery Manager Tool

DM2's Package in the new copied Version will be marked as packaged:

CAST Management StudioNo change from Step 3.

Step 6 - DM2 will Deliver the version to the CAST AIC Portal

In this example, DM2 will now Deliver the Version (including his package) to the CAST AIC Portal. We are using the -close action because we want to close the Version as DM2 is the "last" Delivery Manager.

Deliver

Example:

Windows

set APPLICATION=<Name of the Application that you are working with>
set VERSION=<Name of the Version that you are Delivering>
set LOG_FILE_PATH=<Absolute path to the folder that will be used to store the log files generated using the command line, e.g. C:\TEMP - this folder must exist already!>
set ACTION_Deliver=Deliver -application \"%APPLICATION%\" -version \"%VERSION%\" -close -logFilePath \"%LOG_FILE_PATH%\"

"C:\Program Files (x86)\Java\jre7\bin\javaws.exe" %JNLP_FILE% -Xnosplash -silent -wait -open "%AUTH% %ACTION_Deliver%"

Linux

APPLICATION=<Name of the Application that you are working with>
VERSION=<Name of the Version that you are Delivering>
LOG_FILE_PATH="log1"
ACTION_Deliver="Deliver -application \"$APPLICATION\" -version \"$VERSION\" -close -logFilePath \"$LOG_FILE_PATH\""

"/opt/jre1.8.0_171/bin/javaws" $JNLP_FILE -Xnosplash -silent -wait -open "$AUTH $ACTION_Deliver"

After running this step, you should expect the following:

Delivery Manager Tool

V2 will now be marked as Delivered and Closed (read-only):

CAST Management Studio

The copied version will now move to Delivery done in the CAST Management Studio: