Search

Chapter 7. Environment Variables

download PDF
OpenShift Enterprise uses environment variables to communicate information between cartridges, applications, and the system.
OpenShift Enterprise provides several system environment variables that are available for use at all cartridge entry points.
Place cartridge environment variables in the $cartridge_name/env/ directory. OpenShift Enterprise loads cartridge variables after system environment variables, but before calling your code.

7.1. System Environment Variables

OpenShift Enterprise provides several system environment variables. These variables are read-only.
Table 7.1. System Environment Variables
Name Value
HOME Alias for OPENSHIFT_HOMEDIR.
HISTFILE Bash history file.
OPENSHIFT_APP_DNS The fully qualified domain name of the application using your cartridge.
OPENSHIFT_APP_NAME The name of the application using your cartridge. Assigned by the application developer.
OPENSHIFT_APP_UUID The UUID of the application using your cartridge. Assigned by OpenShift Enterprise.
OPENSHIFT_DATA_DIR The directory where the application and your cartridge store data.
OPENSHIFT_GEAR_DNS The fully qualified domain name of the gear where your cartridge is installed. This may not be the same as OPENSHIFT_APP_DNS).
OPENSHIFT_GEAR_NAME The name of the gear where your cartridge is installed. Assigned by OpenShift Enterprise. This may not be the same as OPENSHIFT_APP_NAME).
OPENSHIFT_GEAR_UUID The UUID of the gear where your cartridge is installed. Assigned by OpenShift Enterprise.
OPENSHIFT_HOMEDIR The home directory of the gear where your cartridge is installed. Assigned by OpenShift Enterprise.
OPENSHIFT_REPO_DIR The directory where the application repository is stored. OpenShift Enterprise runs the application from this location.
OPENSHIFT_TMP_DIR The directory where the application and your cartridge store temporary data.
TMP Alias for OPENSHIFT_TMP_DIR.
TMPDIR Alias for OPENSHIFT_TMP_DIR.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.