Installing agents from the command line

Installing an agent from the command line involves running a batch file or shell script and specifying information about how the agent connects to the server or agent relay.

Before you begin

  • For production environments, create a user account that has the required privileges for the installation.

    If the user account does not have the necessary privileges, the installation fails.

    For AIX, HP, Solaris, Windows and Mac OS, the user account must have access to all working directories used in the process the agent runs.

    For Linux and Unix OS, the user account must have root privileges in order to issue the su or sudo command when installing.

  • Make sure that your networks and firewalls allow communication on the required ports. See Firewall and communication configuration.
  • Set the JAVA_HOME system variable to the location of the JRE or JDK that you are using.
  • Ensure that there is no limit on the maximum memory size and virtual memory size. For example, on most Linux systems, you can run the ulimit -m and ulimit -v commands and ensure that both return the value unlimited. To find out how to remove the limit on the maximum memory size and virtual memory size, see the documentation for the operating system.

About this task

Agents can also be installed directly from the HCL DevOps Deploy (Deploy) web application, see Installing agents remotely.

For simple evaluations, the administrative user can run the agent on the computer where the server is located. Because agent workloads can be resource-intensive, for production environments, do not install agents on the computer where the Deploy server is located. If you plan to run deployments on several target servers, install a separate agent on each one. If, for example, your testing environment consists of three servers, install an agent on each one. Follow the same procedure for each environment the application uses.

Each agent requires the appropriate rights to communicate with the Deploy server. At a minimum, each agent must have these permissions:

  • Open a TCP connection. A Web agent uses one for its WebSocket connection.
  • Open a HTTP(S) connection. The agent must be able to connect to the Deploy user interface to download artifacts from the CodeStation repository.
  • Access the file system. Many agents need read/write permissions to items on the file system.

If the agent communicates with Deploy by using an agent relay, you can install the agent from the command line.

Procedure

To install an agent from the command line:
  1. Download and extract the agent installer using any one of the following ways:
    • To download the installer, log in to the server and click the Help icon at the upper right of any page on the server, and click Tools. Then, click DevOps Deploy Agent, and download and extract the file.
    • To find the installer on the server with the command line, go to the following location, and copy the file to the target computer: installation_folder/opt/tomcat/webapps/ROOT/tools/devops-deploy-agent.zip
    Note: If you are installing the agent on IBM® z/OS® by extracting files to the UNIX file system, you must convert the character encoding for several text-type files in the installation package to IBM®-1047 encoding. If you are installing the agent by using SMP/E, you do not have to convert the character encoding. Move the installation files to the z/OS® computer, and then extract the files. If the unzip program is not installed on the z/OS® computer, use the jar command to extract the files. For instance, type the following text on the command line:
    JAVA_HOME/bin/jar xvf devops-deploy-agent.zip
    Run the convertFilesForZos.sh script to convert the character encoding of the relevant files to IBM®-1047 encoding. After you convert the files, continue with installation.

    If you used the jar command to extract files, add execute permission to convertFilesForZos.sh script first.

  2. After you download and expand the installation package, open the installer directory.
  3. Run the installer.
    Run the install-agent.bat command (Windows) or install-agent.sh (UNIX, Linux, Mac OS, or IBM® z/OS®).
    Note: If you install the agent as a Windows service, the user account must have the following privileges:
    • SE_INCREASE_QUOTA_NAME "Adjust memory quotas for a process"
    • SE_ASSIGNPRIMARYTOKEN_NAME "Replace a process level token"
    • SE_INTERACTIVE_LOGON_NAME "Logon locally"
    The Deploy agent installer is displayed and prompts you to provide the following information. You can accept the default values (displayed in brackets) by pressing Enter. If two options are given, such as Y/n, the uppercase option is the default value. Depending on the options that you select, different prompts display.
  4. For all agents, provide values for the following prompts:
    Enter the directory where agent should be installed.
    For example, enter C:\Program Files\devops-deploy\agent (Windows) or /opt/devops-deploy/agent (UNIX). If the directory does not exist, enter Y to instruct the Installer to create it for you. If you enter an existing directory, the program gives you the option to upgrade the agent. For information about upgrading, see Upgrading agents.
    Note: Do not use any shell expansions or abbreviations, such as the tilde character (~).

    The agent directory length must not exceed 38 characters on IBM® z/OS®.

    Please enter the home directory of the JRE/JDK used to run this agent.
    If Java is already installed, Deploy suggests the Java location as the default value. To accept the default value, press Enter. Otherwise, override the default value, and enter the correct path.
    Will the agent connect to an agent relay instead of directly to the server?
    The default value is N. To configure a connection to an agent relay instead of a connection to the server, specify Y. If you connect directly to a server, skip to step 6. To connect to an agent relay, complete step 5 first.
  5. To connect the agent to an agent relay, provide values for the following prompts:
    Will the agent connect to an agent relay instead of directly to the server.
    Specify y to provide relay configuration in further steps. The default value is N.
    Enter the address of a relay for the agent to use as a proxy.
    Specify the address of the agent relay. The format is http://hostname:port. The default value is http://localhost:20080.
    Do you want to configure another relay to use as a proxy?
    The default value is N. To specify another relay server, press Y.
  6. To connect the agent directly to the server, provide values for the following prompts:
    Enable the agent to verify the server HTTPs certificate? If enabled, you must import the server certificate to the JRE keystore on the agent.
    The default value is N. If you specify y, import the server certificate to the JRE keystore after the installation completes.
    Enter the web agent communication URL for your DevOps Deploy server. It must begin with 'wss://'.
    Specify the secure WebSocket connection URI. The format is wss://hostname:port. The default value is wss://localhost:7919.
    Do you want to configure another failover server connection?
    The default value is N. To specify another failover server, press Y.
    Enter the name for this agent.
    Enter a unique name. The server uses this name to identify this agent. Names are limited to 256 characters and cannot be changed.
    Enter teams (and types) to add this agent to, separated by commas.
    The default value is None.

    Agents can be added to teams the first time they connect to the server. The agent is assigned to the specific teams the first time that it connects to the server. Separate multiple teams by commas. Trailing spaces are ignored. Team names that do not exist are also ignored. To specify the agent's security type for a team, provide the team and security type in the following format: team:type.

    Do you want to install the Agent as Windows service?
    This parameter applies only to Windows. The default value is N. When installed as a service, Deploy captures the PATH variable values. The default service name is DevOps Deploy Agent. Any changes to the values after the service is installed will be used by the agent process when it starts up. For recent versions of Windows, you must run the command as Administrator.
  7. For IBM® z/OS®, provide values for the following prompts:
    Enter the high-level qualifier to install product data sets. [Default: BUZ]
    Specify the high-level qualifier to install product data sets. If the agent is installed by using SMP/E, the high-level qualifier must be the same qualifier that was used in the SMP/E installation.
    Enter the volume serial to install product data sets.
    Specify the volume serial number to install product data sets. If the agent is installed by using SMP/E, the volume serial number must be the same as that was used in the SMP/E installation.
    Enter the URL of the DevOps Deploy server. [Default: https://hostname:8443/]

    Enter the URL with the protocol and port number. The default value is generated using the input hostname and the default port 8443.

    Enter the authentication token for the DevOps Deploy server. You can modify the token later in installed.properties file. [Default: empty]

    Specify an authentication token to be used to import z/OS® component versions.

    To create a token in Deploy, click Settings > Tokens > Create Token. The token is stored in the installed.properties file and can be updated when a new token must be used. The token is encrypted after the first time it is used.

What to do next

Start the agent.