Environment Variables
Spark uses environment variables for cloud authentication and for parametrizing test files.
CLI variables
These control Spark's behavior at runtime:
| Variable | Description |
|---|---|
SPARK_TOKEN | API token for cloud mode (use in CI) |
SPARK_CLOUD_URL | Cloud API server URL (required for --cloud mode) |
SPARK_WEBLINK | Base URL for artifact links in CLI output |
YAML expansion
Any $SPARK_* variable in test files and config files is expanded before parsing. This lets you parametrize tests without hardcoding values.
services:
- name: app
image: $SPARK_APP_IMAGE
environment:
DATABASE_URL: $SPARK_DATABASE_URL
SPARK_APP_IMAGE=myapp:latest SPARK_DATABASE_URL=postgres://... spark run ./tests
Only
SPARK_ prefixed variables are expanded. This is a safety measure — other environment variables (like PATH, HOME, or anything containing credentials) are left untouched and never injected into your test definitions.