App Jobs

Nomatron is in early access. Some advanced workflows may not be covered in the public docs.

This file covers the app-jobs command family.

Commands

  • nomatron app-jobs list
  • nomatron app-jobs create
  • nomatron app-jobs read
  • nomatron app-jobs update
  • nomatron app-jobs delete
  • nomatron app-jobs approval-decision
  • nomatron app-jobs latest-approval-plan
  • nomatron app-jobs plan
  • nomatron app-jobs approval-policy
  • nomatron app-jobs set-approval-policy
  • nomatron app-jobs approval-policy-versions
  • nomatron app-jobs approval-policy-version
  • nomatron app-jobs accept-drift
  • nomatron app-jobs accept-env-drift
  • nomatron app-jobs import
  • nomatron app-jobs speculative-plan
  • nomatron app-jobs deploy
  • nomatron app-jobs promote
  • nomatron app-jobs rollback
  • nomatron app-jobs rollback-candidates
  • nomatron app-jobs destroy

When To Use Them

  • Use app jobs to manage deployable job definitions under an app.
  • Use them when working with Nomad jobs, template jobs, approval policy, drift, promotion, and rollback flows.
  • Use --repo-url when a job should use a different Git repository from its app.
  • Use app-jobs deploy from operator terminals or CI when you want a deployment-oriented command name. It preserves app-jobs plan behavior and queues the same approvable plan endpoint.
  • Use --source-mode file for a single jobspec file. This is the default and requires --jobspec-path.
  • Use --source-mode directory for Nomad job directories. Directory sources require --source-directory, may specify --job-file-path, and may repeat --job-var-file-path for Nomad variable files.
  • Use app-jobs destroy to create a destroy plan for a live Nomad job. Applying that plan stops and purges the Nomad job, but the Nomatron app/job configuration remains.
  • Use app-jobs accept-drift / accept-env-drift to rebase Nomatron desired state onto live Nomad. For NOMAD jobs with a GitHub connection, Nomatron also best-effort opens a PR updating the connected jobspec (JSON or HCL) so ops can review and amend. TEMPLATE jobs skip git write-back. GitHub App Contents must be Read and write.

How To Use Them

List jobs:

bash
nomatron app-jobs list --organization acme --app api

Read one job:

bash
nomatron app-jobs read --organization acme --app api --job template

Examples

Create a template job:

bash
nomatron app-jobs create \
  --organization acme \
  --app api \
  --name "Template Service" \
  --slug template \
  --jobspec-path nomatron.tpl \
  --jobspec-type TEMPLATE

Create a job that uses its app repository:

bash
nomatron app-jobs create \
  --organization acme \
  --app api \
  --name "API Worker" \
  --slug worker \
  --jobspec-path jobs/worker.nomad.hcl \
  --jobspec-type NOMAD

Create a job with a repository override:

bash
nomatron app-jobs create \
  --organization acme \
  --app api \
  --name "Payments Worker" \
  --slug payments-worker \
  --jobspec-path jobs/payments-worker.nomad.hcl \
  --jobspec-type NOMAD \
  --repo-url https://github.com/acme/payments-worker

Create a Nomad job from a directory with separate variable files:

bash
nomatron app-jobs create \
  --organization acme \
  --app api \
  --name "Payments API" \
  --slug payments-api \
  --jobspec-type NOMAD \
  --source-mode directory \
  --source-directory deploy/jobs/payments \
  --job-file-path deploy/jobs/payments/payments.nomad.hcl \
  --job-var-file-path deploy/jobs/payments/base.vars.hcl \
  --job-var-file-path deploy/jobs/payments/generated.json

Directory sources are for Nomad jobspec directories, including directories where Nomad variable values live in separate HCL or JSON var files. JSON var files are supported so generated variable values can be checked in or produced by automation. Directory mode only supports --jobspec-type NOMAD; template jobs should continue to use file mode.

Clear a repository override and return to app repository inheritance:

bash
nomatron app-jobs update \
  --organization acme \
  --app api \
  --job payments-worker \
  --clear-repo-url

app-jobs list and app-jobs read show the effective repository Nomatron will use for the job.

Set approval policy from a file:

bash
nomatron app-jobs set-approval-policy \
  --organization acme \
  --app api \
  --file ./approval-policy.json

The approval policy applies to the whole app, so set-approval-policy takes no --job flag.

Create a speculative plan:

bash
nomatron app-jobs speculative-plan \
  --organization acme \
  --app api \
  --job template \
  --environment staging \
  --ref feature/my-change

Queue an approvable plan:

bash
nomatron app-jobs plan \
  --organization acme \
  --app api \
  --job template \
  --ref main \
  --commit-sha abc123

Queue a deploy plan with the clearer CI/operator command:

bash
nomatron app-jobs deploy \
  --organization acme \
  --app api \
  --job template \
  --environment default \
  --ref main \
  --commit-sha abc123

Promote to the next environment:

bash
nomatron app-jobs promote --organization acme --app api --job template

List healthy rollback candidates in an environment, then create a rollback plan (defaults to the previous healthy release before the current head):

bash
nomatron app-jobs rollback-candidates \
  --organization acme \
  --app api \
  --job template \
  --environment staging

nomatron app-jobs rollback \
  --organization acme \
  --app api \
  --job template \
  --environment staging

Pass --source-release-id to pin a specific healthy prior release. Rollback replays that release’s rendered jobspec into the same environment (including variables as-of that deploy), then follows the normal approval → apply → health path.

Human output for deploy, promote, and rollback includes the operation ID, state, approval state, target environment, and next action when the API returns those fields. --format json prints the API response data unchanged.

Create a destroy plan for one app job:

bash
nomatron app-jobs destroy \
  --organization acme \
  --app api \
  --job template

Use --yes to skip the confirmation prompt in automation. The command prints the destroy plan operation ID, approval state, ready-for-apply state, and target rows including cluster, namespace, environment, and Nomad job ID.

Destroy plans are approval-aware. If the app approval policy requires approval, the returned plan is not ready for apply until the required approval decisions are recorded. Applying the plan stops and purges the live Nomad job only; redeploy the app job to create a new live runtime target and resume drift checks.