DeployGar

The DeployGar tool deploys and manages applications and services in a Genero archive (.gar) file on a Genero Application Server secured by a Genero Identity Provider.

Set the environment

Before executing the command, set the environment using the envidp script, found in $FGLDIR/web_utilities/services/gip. On Microsoft® Windows, the script is named envidp.bat.

Syntax

DeployGar command [ options ] [ args ]  
  1. command. There are nine commands to perform actions on Genero archive (.gar) files on the Genero Application Server (GAS):
    1. list lists all deployed gar files.
    2. deploy deploys a gar file.
    3. undeploy undeploys a gar file.
    4. enable enables a gar file.
    5. disable disables a gar file.
    6. secure secures a gar file.
    7. unsecure unsecures a gar file.
    8. delegate configures delegation in a deployed Genero archive.
    9. config configures application security on the Identity Provider (IdP).
  2. options. Some options are specific to commands and these are described in the tables in DeployGar command options.
  3. args include the URL of the GAS. Some arguments are specific to commands and these are described in the next paragraphs.

Syntax 1: list archives

DeployGar list [ options ] url  
  1. options are described in Table 1
  2. url is the GAS base URL
For examples, go to Usage.

Syntax 2: deploy/enable/secure archives

DeployGar { 
| deploy | undeploy 
| enable | disable 
| secure | unsecure } [  options  ] archive  url 
  1. options are described in Table 1
  2. archive is the Genero archive filename
  3. url is the GAS base URL
For examples, go to Usage.

Syntax 3: delegate

DeployGar delegate [ options ] archive xcf url 
  1. options are described in Table 2
  2. archive is the Genero archive filename
  3. xcf is the filename of the application configuration file (.xcf) in the archive
  4. url is the GAS base URL

Syntax 4: config

DeployGar config [ options ] operation client_id url 
  1. options are described in Table 3
  2. operation to perform security configuration on IdP must be one of the following:
    { get | set }
  3. client_id is the OAuth client ID of the application
  4. url is the GAS base URL
For examples, go to Automate application configuration via scripts.

DeployGar command options

Table 1. DeployGar options specific to the list/deploy/enable/secure commands
Option Description

-h  --help

Displays help for the command.

-u, --username username

Specifies the HTTP user name.

-p, --password password

Specifies the password of the HTTP user.
-t, --token value Specifies the access token value.
-f, --tokenfile filename Specifies the access token file.
-x, --xml Output result of command in XML format.
Table 2. DeployGar options specific to the delegate command
Option Description

-h  --help

Displays help for the command.

-u, --username username

Specifies the HTTP user name.

-p, --password password

Specifies the password of the HTTP user.
-t, --token value Specifies the access token value.
-f, --tokenfile filename Specifies the access token file.
Table 3. DeployGar options specific to the config command
Option Description

-h  --help

Displays help for the command.

-u, --username username

Specifies the HTTP user name.

-p, --password password

Specifies the password of the HTTP user.
-t, --token value Specifies the access token value.
-f, --tokenfile filename Specifies the access token file.
-c, --config filename Specifies the configuration filename.

Usage

Note:

The DeployGar tool is located in your $FGLDIR/web_utilities/services/gip/bin/deploy directory.

The DeployGar tool allows you to manage Genero archive (.gar) files at the command line. For instance, you can use this tool to deploy and configure secure applications or services on an external GAS or using a script.

Use a command with the help option to display available options. For example:

DeployGar config --help

Some examples using DeployGar are given in the next paragraphs. To run DeployGar commands, you will need to have a valid access token. The GetToken command allows you to get access tokens at the command line.

Get list of deployed gar files

Run this command to get a list of deployed gar files on a GAS. Mainly, you would use this to check your access is working; that you have an up-to-date access token, and that the GAS URL is reachable.

DeployGar list --xml --tokenfile mytoken.json GAS_base_URL

Where:
  1. The --xml option is specified for the format of the output.
  2. The --tokenfile option needs the path to a filename where the access token got from the IdP is saved. See GetToken for details of getting the access token.
  3. GAS_base_URL is the URL of the GAS.
    https://host:port/gas
This sample shows the XML output:
<?xml version="1.0" encoding="UTF-8"?><DEPLOYMENT success="TRUE">
  <MESSAGE>3 archive(s) deployed
</MESSAGE>
  <ARCHIVE name="myGarfile" enabled="TRUE">
    <DESCRIPTION>Price program</DESCRIPTION>
    <DEPLOYMENT_PATH>C:\ProgramData\FourJs\gas\5.00.03-202410221156/deployment/myGarfile-20241025-111957</DEPLOYMENT_PATH>
    <APPLICATION xcf="price.xcf"/>
  </ARCHIVE>
#...

Deploy a gar file

Run this command to deploy a Genero archive file.

DeployGar deploy -f mytoken.json myGarfile.gar GAS_base_URL

Where:
  1. The -f option (short option for --tokenfile) gives the path to a file where the access token got from the IdP is saved.
  2. GAS_base_URL is the URL of the GAS.
    https://host:port/gas
Sample output from the command:
COMMAND deploy succeeded
  MESSAGE:
    Found application price.xcf.
  MESSAGE:
    Optimizing by compressing static resources...
  MESSAGE:
    Optimizing by compressing public resources...
  MESSAGE:
    Archive myGarfile.gar successfully deployed.

Secure a gar file

Run this command to secure applications deployed in a Genero archive file.

DeployGar secure -f mytoken.json myGarfile.gar GAS_base_URL

Where:
  1. The -f option (short option for --tokenfile) gives the path to a file where the access token got from the IdP is saved.
  2. GAS_base_URL is the URL of the GAS.
    https://host:port/gas
In this example, the output from a successful command includes the client_id of the application, which you can use in other commands, such as configuring scopes for users accessing the application:
[{"client_id":"10DC13F0-B4F9-4C71-B8D8-8AFA26194444","xcf":"price.xcf","kind":"APPLICATION"}]