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:

  1. edit the template;
  2. define or update the variables it needs;
  3. render it for a real environment;
  4. inspect the output; and
  5. 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:

bash
nomatron templates render \
  --organization acme \
  --app api \
  --job web-template \
  --file ./nomatron.tpl \
  --environment dev

Or render the configured template directly from Git:

bash
nomatron templates render-git \
  --organization acme \
  --app api \
  --job web-template \
  --environment dev

That 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:

hcl
NOMATRON_VAR_APP_IMAGE_REPOSITORY

instead of:

hcl
NOMATRON_VAR_IMAGE_REPOSITORY

A 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.

A durable pattern for template-backed jobs is:

  1. keep the template file in Git next to the workload source;
  2. keep variable keys stable over time;
  3. use defaults for the normal baseline;
  4. use environment overrides only where behavior truly changes;
  5. render in dev first;
  6. inspect the rendered output before promotion; and
  7. evolve the template and variable set together.