deploy and post_deploy hooks can access all runtime environment variables.
Use this to vary those hooks based on the environment.
Check the PLATFORM_ENVIRONMENT_TYPE variable to see if it’s in a production environment:
.upsun/config.yaml
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Change what runs in your hooks depending on the current environment type.
deploy and post_deploy hooks can access all runtime environment variables.
Use this to vary those hooks based on the environment.
Check the PLATFORM_ENVIRONMENT_TYPE variable to see if it’s in a production environment:
applications:
myapp:
hooks:
deploy: |
if [ "$PLATFORM_ENVIRONMENT_TYPE" = production ]; then
# Run commands only when deploying to production
else
# Run commands only when deploying to development or staging environments
fi
# Commands to run regardless of the environment
Was this page helpful?