Authoring And Testing
Nomatron is in early access. Some advanced workflows may not be covered in the public docs.
The safest way to write Nomatron templates is to treat authoring as an iterative loop:
- edit the template;
- define or update the variables it needs;
- render it for a real environment;
- inspect the output; and
- fix any missing or incorrectly typed values before the job is used for deployment.
Start With A Small Valid HCL Shape
Begin with a minimal valid jobspec and then introduce variable references gradually.
That is usually easier than writing a large template full of unresolved tokens and trying to debug everything at once.
Preview The Rendered Output
Use the CLI to render a local template file:
nomatron templates render \
--organization acme \
--app api \
--job web-template \
--file ./nomatron.tpl \
--environment devOr render the configured template directly from Git:
nomatron templates render-git \
--organization acme \
--app api \
--job web-template \
--environment devThat lets you verify:
- all references resolved;
- the rendered HCL is valid;
- numbers and booleans were substituted correctly; and
- environment-specific values look the way you expect.
What To Check In The Rendered Output
When you preview a template, look for:
- missing references;
- values that resolved from the wrong scope;
- string values where a number or boolean should be;
- environment values that did not override the default; and
- sensitive fields that should stay masked in preview-style output.
Common Debugging Cases
A Variable Shows Up As Missing
Usually one of these is true:
- the key does not exist;
- the key exists in the wrong scope;
- the environment override was added to the wrong environment; or
- the template token spelling does not exactly match the variable key.
A Value Comes From The Wrong Scope
That usually means the template used an implicit reference and a nearer variable existed than you expected.
If the source of truth matters, switch the token to an explicit scope like:
NOMATRON_VAR_APP_IMAGE_REPOSITORYinstead of:
NOMATRON_VAR_IMAGE_REPOSITORYA Number Or Bool Renders Incorrectly
Check the variable value_type.
If a count or resource value is stored as string instead of number, the rendered HCL may not match the shape you intended.
Structured Data Is Hard To Manage
If a value is really a list or object, prefer json instead of trying to force everything into string concatenation inside the template.
Recommended Authoring Pattern
A durable pattern for template-backed jobs is:
- keep the template file in Git next to the workload source;
- keep variable keys stable over time;
- use defaults for the normal baseline;
- use environment overrides only where behavior truly changes;
- render in
devfirst; - inspect the rendered output before promotion; and
- evolve the template and variable set together.