This guide is applicable to Dagster Cloud.
Dagster Cloud provides a set of automatically populated environment variables, such as the name of a deployment or details about a branch deployment commit, that can be used to modify behavior based on environment.
Want to see an example? Check out the Testing against production with Dagster Cloud Branch Deployments guide for an in-depth look at using environment variables to test Dagster code without impacting production.
The following variables are available in every deployment of your Dagster Cloud instance, including full (e.g., prod
) and branch deployments.
Property | Description |
---|---|
DAGSTER_CLOUD_DEPLOYMENT_NAME | The name of the Dagster Cloud deployment. For example, prod . |
DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT | If 1 , the deployment is a branch deployment. Refer to the Branch Deployment variables section for a list of variables available in branch deployments. |
The following environment variables are currently available only in a branch deployment.
For every commit made to a branch, the following metadata is available:
Property | Description |
---|---|
DAGSTER_CLOUD_GIT_SHA | The SHA of the commit. |
DAGSTER_CLOUD_GIT_TIMESTAMP | The time the commit occurred. |
DAGSTER_CLOUD_GIT_AUTHOR_EMAIL | The email of the git user who authored the commit. |
DAGSTER_CLOUD_GIT_AUTHOR_NAME | The name of the git user who authored the commit. |
DAGSTER_CLOUD_GIT_MESSAGE | The message associated with the commit. |
DAGSTER_CLOUD_GIT_BRANCH | The name of the branch associated with the commit. |
DAGSTER_CLOUD_GIT_REPO | The name of the repository associated with the commit. |
DAGSTER_CLOUD_PULL_REQUEST_ID | The ID of the pull request associated with the commit. |
DAGSTER_CLOUD_PULL_REQUEST_STATUS | The status of the pull request at the time of the commit. Possible values are OPEN , CLOSED , and MERGED . |