Move Settings Into Your Repo
Some app settings depend on the code: a health check path only makes sense
once your app answers it, a release command only makes sense once the
migration it runs exists. Moving those settings into a
d2o-paas.yaml file in your repository means
they travel with the version they belong to — a rollback restores the code
and the settings it needs together, instead of leaving an old version
running against a health check or release command meant for the version
after it.
This walks through moving a web app’s health check and release command, and a worker’s process, out of the dashboard and into the repository.
1. See what’s set today
paas apps info -o acme -p shop -e production -a web
This prints the app’s current settings, including its health check and
release command — whatever you’ve set in the dashboard or with
paas apps update up to now. Note down the values you want to move; you’ll
write the same ones into the file.
2. Write them into d2o-paas.yaml
Create d2o-paas.yaml at the root of your repository (or the app’s
--source-dir, if it has one):
release:
command: bin/migrate
health_check:
path: /health
apps:
worker:
process: worker
This example moves a top-level health check path and release command — both
shared by every app built from this repository — and gives the worker app
an explicit process, matching a worker: line in its Procfile. Your own file
only needs the fields you’re moving; see
d2o-paas.yaml Reference for every field and
how apps.<name> overrides the top-level defaults.
3. Check it before you push
paas manifest check -o acme -p shop -e production
$ paas manifest check -o acme -p shop -e production
d2o-paas.yaml is valid for production
This catches a typo’d field name or an out-of-range value before it reaches a build. See d2o-paas.yaml Reference for what an invalid file’s errors look like.
4. Push
git add d2o-paas.yaml
git commit -m "Move health check and release command into d2o-paas.yaml"
git push paas main
After the deployment
Once this version is live, the fields it sets show “from d2o-paas.yaml”
in the dashboard and can’t be edited there — paas apps update on one of
them fails with a message telling you to change it in the file instead. This
is expected: the file is now the source of truth for those fields, for as
long as a deployed version sets them.
Handing a field back
To give a field back to the dashboard or CLI, delete it from
d2o-paas.yaml and push. Once the new version with the field removed is
live, the dashboard and CLI setting applies again — including whatever value
it already held, so set it to what you want first if you plan to keep using
it.
Next steps
- d2o-paas.yaml Reference — every field, merging rules, errors and warnings
- Procfile — process selection and the release line
- Deployments, Health Checks & Rollback — health checks and the release command in full