Environment Variables

Custom Environment Variables

You can define custom environment variables from the Squash admin interface.

Go to Settings -> Repositories and then click on “Settings” for a given repository. Note that the “Settings” link will only be visible for active repositories.

Each environment variable defined on this page will become available within the deployment host and docker containers.

../_images/custom-environment-variables.png

Default Environment Variables

Squash automatically sets a number of environment variables during each deployment. These environment variables are made available on the deployment host server and within each docker container.

Squash will set these variables right before the docker build or docker-compose build process.

SQUASH_DOMAIN

The full Squash deployment URL including the actual squash.io domain or the custom domain being used (if applicable) for the current deployment.

Example:

cartv3-i3xg7.squash.io

Or when using a custom domain:

cartv3-i3xg7.example.com

SQUASH_BRANCH

This is the original branch name in GitHub including any special characters. Note that the original branch name will not always match the branch name that appears in the URL since Squash removes special characters that don’t fit within the URL schema.

SQUASH_BRANCH_WITH_ID

This is the remaining component of all Squash deployment URLs excluding the domain name.

For this given deployment URL:

cartv3-i3xg7.squash.io

The value of SQUASH_BRANCH_WITH_ID will be:

cartv3-i3xg7