13.5.3. Directory Environment Variables

Directory environment variables return the directories where an application resides. These variables are always available to the application, regardless of which cartridges the application is using.

Table 13.4. Directory Environment Variables

Environment Variable Name Purpose
OPENSHIFT_HOMEDIR The home directory of the application.
OPENSHIFT_DATA_DIR A persistent data directory.
OPENSHIFT_REPO_DIR Repository containing the currently deployed version of the application.
OPENSHIFT_TMP_DIR A temporary directory you can use; SELinux protects data in this directory from other users.
OPENSHIFT_LOG_DIR Where all cartridge logs are stored.

Note

Many of these directories are emptied and rebuilt whenever new code is pushed to an application. The only persistent directory is OPENSHIFT_DATA_DIR. Therefore, Red Hat recommends that you store persistent files in the OPENSHIFT_DATA_DIR directory.