Profiles
Profiles are environment overlays for the same repo workflow. They let you keep one task graph while adjusting vars and selected task fields per environment.
What Profiles Override
Profiles can override:
vars- specific task fields via
tasks.<name>:whentimeoutenv
profiles:
staging:
vars:
region: eu-west-1
tasks:
deploy:
env:
DEPLOY_TARGET: staging
timeout: 15m
prod:
vars:
region: us-east-1
tasks:
deploy:
when: branch() == "main"
env:
DEPLOY_TARGET: prod
timeout: 30mSelecting Profiles
You can select profiles through:
- environment variable
QP_PROFILE - repeated
--profileflags (stacking) - profile default expression (
profiles._default)
Environment variable
QP_PROFILE=staging qp deployCLI flags
qp deploy --profile staging
qp deploy --profile staging --profile high-memoryLater profiles in the list apply on top of earlier ones.
_default Profile Expression
Use _default to make selection dynamic from environment:
profiles:
_default: "{{env.QP_PROFILE}}"
staging:
vars:
region: eu-west-1
prod:
vars:
region: us-east-1If QP_PROFILE is set, that profile becomes active automatically.
Profiles In Expressions
Use profile() in CEL conditions:
tasks:
deploy:
desc: Deploy in non-dev profiles only
cmd: ./scripts/deploy.sh
when: profile() != "dev"This is useful when one task should exist everywhere but run only in selected environments.
Worked Example: Safe Local + Production Gate
vars:
region: local
tasks:
test:
desc: Run tests
cmd: go test ./...
deploy:
desc: Deploy service
cmd: ./scripts/deploy.sh --region {{vars.region}}
safety: external
profiles:
dev:
vars:
region: local
tasks:
deploy:
when: false
prod:
vars:
region: us-east-1
tasks:
deploy:
when: branch() == "main"
timeout: 30m
env:
CONFIRM: "yes"qp deploy --profile dev
# skipped
qp deploy --profile prod --allow-unsafe
# runs only on mainProfile Stacking Strategy
A practical pattern is to split overlays by concern:
- environment:
staging,prod - runtime size:
high-memory - observability:
debug-tracing
Then combine:
qp check --profile staging --profile debug-tracingNext Step
For sensitive values and redaction behavior, continue to Secrets.