Skip to content

Environment Variables

Complete reference of all environment variables used by the package.

Required Variables

VariableDescriptionExample
RHDH_VERSIONRHDH version to deploy"1.5"
INSTALLATION_METHODDeployment method"helm" or "operator"

Auto-Generated Variables

These are set automatically during deployment:

VariableDescriptionSet By
K8S_CLUSTER_ROUTER_BASEOpenShift ingress domainGlobal setup
RHDH_BASE_URLFull RHDH URLRHDHDeployment

Optional Variables

VariableDescriptionDefault
CIEnables auto-cleanup-
CHART_URLCustom Helm chart URLoci://quay.io/rhdh/chart
SKIP_KEYCLOAK_DEPLOYMENTSkip Keycloak auto-deployfalse

Keycloak Variables

Required when using auth: "keycloak":

VariableDescription
KEYCLOAK_BASE_URLKeycloak instance URL
KEYCLOAK_REALMRealm name
KEYCLOAK_CLIENT_IDOIDC client ID
KEYCLOAK_CLIENT_SECRETOIDC client secret
KEYCLOAK_METADATA_URLOIDC discovery URL
KEYCLOAK_LOGIN_REALMLogin realm name
KEYCLOAK_USER_NAMEDefault test username
KEYCLOAK_USER_PASSWORDDefault test password

These are automatically set by KeycloakHelper.configureForRHDH().

GitHub Variables

For GitHub integration:

VariableDescriptionRequired
GITHUB_TOKENGitHub personal access tokenFor API/auth
GH_USER_NAMEGitHub usernameFor login
GH_USER_PASSWORDGitHub passwordFor login
GH_2FA_SECRET2FA secret for OTPFor login

Custom Variables

Use in configuration files:

yaml
# tests/config/app-config-rhdh.yaml
myPlugin:
  apiUrl: ${MY_PLUGIN_API_URL}
  apiKey: ${MY_PLUGIN_API_KEY:-default-key}
yaml
# tests/config/rhdh-secrets.yaml
stringData:
  MY_PLUGIN_API_KEY: ${MY_PLUGIN_API_KEY}

Setting Variables

.env File

Create .env in your project root:

bash
RHDH_VERSION="1.5"
INSTALLATION_METHOD="helm"
SKIP_KEYCLOAK_DEPLOYMENT=false

# Secrets
GITHUB_TOKEN=ghp_xxxxx
MY_API_KEY=secret-value

Load with dotenv:

typescript
// playwright.config.ts
import dotenv from "dotenv";
dotenv.config({ path: `${import.meta.dirname}/.env` });

CI/CD

Set in your CI pipeline:

yaml
# GitHub Actions
env:
  RHDH_VERSION: "1.5"
  INSTALLATION_METHOD: "helm"
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Runtime

Set programmatically:

typescript
test.beforeAll(async ({ rhdh }) => {
  process.env.MY_CUSTOM_URL = await rhdh.k8sClient.getRouteLocation(
    rhdh.deploymentConfig.namespace,
    "my-service"
  );

  await rhdh.deploy();
});

Variable Precedence

  1. Runtime (process.env)
  2. CI/CD environment
  3. .env file
  4. Default values (${VAR:-default})

Released under the Apache-2.0 License.