CDAF Control Variables.

Due to inconsistencies between Windows and Linux handling of environment variables, these have been divided between environment variables that are set before calling an entry script to alter the behaviour of CDAF, and environment variables that are set within bash scripts to make them globally available.

Control Variables

The following environment variables are available to control the behaviour of CDAF

Variable Description
CDAF_BRANCH_NAME Used by entry.ps1/entry.sh
Override the branch name, primarily to test CI behaviour for non-default branch, i.e. main
CDAF_BUILD_ENV Define the build environment, if not set, defaults will be used, see execution engine Build-time Variables for details
CDAF_DOCKER_REQUIRED containerBuild will attempt to start Docker if not running and will fail if it cannot, rather than falling back to native execution
CDAF_DOCKER_RUN_ARGS containerBuild additional run arguments, e.g. ‘–memory=2048m’
CDAF_DELIVERY The default target environment for cdEmulate and entry, defaults are
LINUX, or
WINDOWS for on-domain or WORKGROUP for off-domain
CDAF_ERROR_DIAG Dependency injected custom call if error occurs in Execution Engine
CDAF_HOME_MOUNT to disable volume mount for containerDeploy set to ‘no’, note: this can be overridden a solution level, using CDAF_HOME_MOUNT as property
CDAF_IGNORE_WARNING If messages are logged to standard error, the Execution Engine will log but not halt, however is this is set to yes, processing will halt
yes or no, default is yes
CDAF_OVERRIDE_TOKEN Default marker for DETOKN or PROPLD in Execution Engine is %, i.e. %key_name%, the markers can be changed using this environment variable
CDAF_SKIP_CONTAINER_BUILD containerBuild will not be performed if this environment variable is set to any value
CONTAINER_IMAGE Override containerImage in containerBuild & imageBuild
CDAF_CB_{variable_name} Prefix used in containerBuild to supply local variables into the build time container
CDAF_CD_{variable_name} Prefix used in containerDeploy to supply local variables into the deploy time container
CDAF_IB_{variable_name} Prefix used in containerBuild to supply during image construction

Global Variables

These variables are available to child scripts, custom scripts and task execution engine, see also Build-time Variables.

Variable Description
CDAF_CORE CDAF helper script path
WORKSPACE_ROOT Static for solution, WORKSPACE will change for project (build) or target (deploy)

See also Build-time Variables.

Image Registry

These override Solution Properties properties. They are used to push the image created by dockerBuild to pull a base image from a private registry.

Variable Description
CDAF_SKIP_PULL Skip updating of image
CDAF_PULL_REGISTRY_URL Image registry URL, example myregistry.local (do not set for dockerhub)
CDAF_PULL_REGISTRY_USER Registry user, example registryuser (if not set, default is ‘.’)
CDAF_PULL_REGISTRY_TOKEN Registry token, example xyzx9234sxsrwcqw34

These override Solution Properties properties. They are used to push the image created by imageBuild to push to a private registry.

Variable Description
CDAF_REGISTRY_URL Image registry URL, example myregistry.local (do not set for dockerhub)
CDAF_REGISTRY_TAG Image tag(s), can being single value latest or list latest ${BUILDNUMBER}
CDAF_REGISTRY_USER Registry user, example registryuser (if not set, default is ‘.’)
CDAF_REGISTRY_TOKEN Registry token, example xyzx9234sxsrwcqw34

These override Solution Properties properties. They are used to push the image created by dockerPush to push to a private registry.

Variable Description
CDAF_PUSH_REGISTRY_URL Image registry URL, example myregistry.local (do not set for dockerhub)
CDAF_PUSH_REGISTRY_TAG Image tag(s), can being single value latest or list latest ${BUILDNUMBER} (default is latest)
CDAF_PUSH_REGISTRY_USER Registry user, example registryuser (if not set, default is ‘.’)
CDAF_PUSH_REGISTRY_TOKEN Registry token, example xyzx9234sxsrwcqw34

Next: Sensitive Data Strategies