Repository navigation
v2.31.0: Load daemon env from dotenv files and nest groups
Daemons can now load environment variables from dotenv files with env_file, and groups can include other groups so shared daemons are listed only once.
Added
-
env_fileloads daemon environment from dotenv files (#1031) by @jdx. You can keep secrets in a git-ignored file such as.env.localinstead of a committedpitchfork.toml. Closes #1030.[daemons.api] run = "npm run server" env_file = [".env", ".env.local"] env = { NODE_ENV = "development" }
- Relative paths resolve from the directory of the
pitchfork.tomlthat declares the daemon, and~is expanded. - Missing files are skipped, so
.env.localcan be optional. A file that exists but can't be parsed causes an error that names the file. - Precedence, from lowest to highest: top-level
[env], then earlier files, then later files, then the daemon's ownenv. - Files are parsed the same way mise parses them, including quoting,
exportprefixes and${VAR}references. Values go through the same Tera templating asenv, so you can use{{ daemons.api.port }}. The values are also available as{{ env.* }}in hook templates. - Files are read when the daemon starts, and those values are reused for watch-triggered restarts and automatic retries. Run
pitchfork restartto pick up edits to a file. Values from the files are never written back topitchfork.toml.
- Relative paths resolve from the directory of the
-
Groups can include other groups (#1037) by @jdx. Add the new
groupskey to a group to include other groups:[groups.core] daemons = ["postgres", "redis"] [groups.all] groups = ["core"] daemons = ["api", "worker"]
pitchfork start --group allstartspostgres,redis,apiandworker.stop,restartandwaitalso accept--group all.- The daemons from included groups come first, in the order the groups are listed, followed by the group's own
daemons. A daemon that appears more than once stays at its first position. - Includes can be nested. If several included groups share a group, that is fine.
daemonsis now optional, so a group can contain only includes.- Includes are resolved after configs are merged, so a group can include a group defined in another config file.
- Including an undefined group is an error with a "did you mean" suggestion. A cycle is also an error and names the chain, for example
group include cycle: a -> b -> a. Both errors are reported when the group is used. - The web UI stack page also expands includes. If a group's includes can't be resolved, that group is left out and its error is shown on the page. Other groups keep their controls.
- The daemons from included groups come first, in the order the groups are listed, followed by the group's own
Fixed
- The mise integration guide showed an empty page and now shows its content again (#1043) by @jdx. Fixes #1042.
Full Changelog: v2.30.1...v2.31.0
💚 Sponsor pitchfork
pitchfork is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work.
If pitchfork has a place in your development workflow, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep pitchfork fast, free, and independent.