SquareScale exposes some environment variables at the project level (like global variables in a way) and at the service level (like local variables to your service, if you prefer).

Project Environment Variables

The global environment variables are available from the "Environment" tab: 

You can simply add a new environment variable to your service:

You can do the same using the CLI: 

$ sqsc env set -project "my-demo-app" APP_NAME MyCustomerID
◒ set environment variable ... done
Successfully set global variable 'APP_NAME' to value 'MyCustomerID'

Service Environment Variables

The same way project-level environment variables work, service-level environment variables are available and new ones can also be set.

To configure a service, click on the settings icon of the service:

There, you can see and add new service-level environment variables:

It's possible to do the same thing using the CLI:

$ sqsc env set -project "my-demo-app" -container "wordpress:4" WORDPRESS_DB_HOST db.service.consul
◓ set environment variable ... done
Successfully set variable 'WORDPRESS_DB_HOST' to value 'db.service.consul' 

How to use the variables from inside my service or application?

Environment variables are propagated to your Docker containers the same way docker run -e does. Each language has a different way of accessing environment variables.

Did this answer your question?