Print the entire Procfile with shell variables substituted in every command. The output uses the same process: command shape as the input, so it can be diffed against snapshots or piped into another tool.
procfile-util expand [flags]| Flag | Default | Description |
|---|---|---|
-p, --process-type |
empty | If set, only the matching process type is emitted. Without it, every entry is printed. |
-a, --allow-getenv |
false |
Allow the current shell environment to provide variable values. |
-e, --env-file |
empty | Path to a dotenv file. Values in this file take precedence over --allow-getenv and the built-in defaults. |
See the global flags for the rest. The output uses whatever character is set as --delimiter.
- Exits
0after printing the expanded Procfile. - Exits
1if the Procfile fails to parse, if the env file cannot be read, or if any expansion produces an error.
The expansion rules are identical to show. See Variable expansion for the source-priority order.
Given .env.ci:
RAILS_ENV=ci
PORT=4000
And:
web: bundle exec puma -p $PORT
worker: bundle exec sidekiq -e $RAILS_ENV
Render every entry against the env file:
$ procfile-util expand --env-file .env.ci
web: bundle exec puma -p 4000
worker: bundle exec sidekiq -e ciRestrict to a single process while still using the env file:
$ procfile-util expand --process-type worker --env-file .env.ci
worker: bundle exec sidekiq -e ciSnapshot test against an expected output:
procfile-util expand --env-file .env.ci > rendered.procfile
diff -u expected.procfile rendered.procfileshow- print one process command rather than the whole file.- Variable expansion - precedence rules for env files, getenv, and defaults.
- CI usage - using
expandin a snapshot test.