Configure Environment Variables

1. Configure required environment variables for any job running on a server

The following steps enable you to set environment variables for any job running on the selected server.
 
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘Transport Tab’ 
  • Make sure the plugin selected is the ‘SSH Transport’ plugin.
  • Scroll down to the ‘Server Environment Variables’ panel.
  • Add environment variables as required (see example below)
  • Note that the RapidDeploy Orchestration job accepts JAVA_OPTS, which can be used to define any Java properties and parameters, such as initial and maximum heap sizes, for the job execution itself. In the example below, the RapidDeploy job will run with a maximum heap of 2048Mb

2. Changing the server TEMP directory

Typically the TEMP directory on Linux/Unix server is set to /tmp . However, some system administrators do not want to have deployments or scripts run from /tmpand therefore the folder may not have execute permissions. To change to a different folder (with execute permissions), you need to tell both the OS and Java to use a different TEMP folder.
The following steps enable you to set /tmp to a different folder for any job running on the selected server. In the screenshots below, the TEMP folder is changed to /var/tmp, but you can change to any folder of your choice.

2.1 Changing the deployment temporary directory

This is where objects are copied to on the target server prior to running the job. If you wish to change this from the default of /tmp, follow these steps:
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘General Tab’ 
  • Scroll down to the ‘Server Details’ panel.
  • Change the ‘Remote Build Store’ to the new TMP folder, e.g. /var/tmp
Click to enlarge

2.1 Changing the TEMP environment variables

If you want to change where deployment operations and scripts are run, from the default of /tmp, follow these steps:
 
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘Transport Tab’ 
  • Make sure the plugin selected is the ‘SSH Transport’ plugin.
  • Scroll down to the ‘Server Environment Variables’ panel.
  • Add environment variables as shown in the screenshot (see example opposite)
  • The first three variables, TMP, TMPDIR, TEMP set the OS to use the set TEMP dir of /var/tmp
  • The last two variables, _JAVA_OPTIONS and JAVA_OPTS tell Java to use the set TEMP dir of /var/tmp.
Click to enlarge