The job environment
nuf builds the environment for the work it starts, and only for that. A job’s steps, and a command run with nuf env run, get names from layers of YAML files. Your own shell is never changed.
The layers
Section titled “The layers”Three layers, and the last one wins each name whole:
- the
env:section of the repository’snuf.yaml, which travels with the code and holds no secret; .nuf/config/env.yaml, with its section for this platform;.nuf/config/local/env.yaml, this machine’s own.
# .nuf/config/env.yaml: shared, in Git, no secretsAPP_MODE: testplatforms: <platform>: # a section named as nuf names the platform; nuf env shows this machine's BROWSER_FLAGS: "--headless"# .nuf/config/local/env.yaml: this machine only, git-ignored, readable by you only (chmod 600)API_TOKEN: "..."The reader of the env: section in nuf.yaml is not built yet, so today the two files in .nuf/config/ are the layers.
The rules
Section titled “The rules”- Literal. A value is taken as written.
$HOME, backticks and$(...)stay as they are; nothing is expanded or run. YAML’s own quoting still applies, so single-quote a value to keep every character. - Only what nuf starts. The values reach only a job’s steps and
nuf env run. They never reach your shell, or nuf’s own calls to git and the repository host. - The local file stays local. Nothing from
config/local/env.yamltravels to a rented machine, enters the ledger or is printed. - Part of a job’s identity. The shared layers are part of a job’s key, so two environments never share a check result.
- No dotenv. nuf reads no
.envfile and no.envrc. A repository’s own.env.localbelongs to its framework, and.envrcis a script.
nuf refuses to run jobs with a config/local/env.yaml that others may read or write. It names the fix, chmod 600.
The commands
Section titled “The commands”nuf env lists each name with the layer it comes from. It shows a value only from a shared file. A local value shows as set in config/local/env.yaml, never its value.
nuf env run -- <command> runs one command in the current folder with the job environment on top of your shell’s, so a builder’s quick checks see what its jobs see:
nuf env run -- npm testNothing after -- is read as a flag. The command’s own exit code is nuf’s answer. Only nuf’s own failures before the command starts answer 2, 64 or 70.