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 listnomatron app-jobs createnomatron app-jobs readnomatron app-jobs updatenomatron app-jobs deletenomatron app-jobs approval-decisionnomatron app-jobs latest-approval-plannomatron app-jobs plannomatron app-jobs approval-policynomatron app-jobs set-approval-policynomatron app-jobs approval-policy-versionsnomatron app-jobs approval-policy-versionnomatron app-jobs accept-driftnomatron app-jobs accept-env-driftnomatron app-jobs importnomatron app-jobs speculative-plannomatron app-jobs deploynomatron app-jobs promotenomatron app-jobs rollbacknomatron app-jobs rollback-candidatesnomatron 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-urlwhen a job should use a different Git repository from its app. - Use
app-jobs deployfrom operator terminals or CI when you want a deployment-oriented command name. It preservesapp-jobs planbehavior and queues the same approvable plan endpoint. - Use
--source-mode filefor a single jobspec file. This is the default and requires--jobspec-path. - Use
--source-mode directoryfor Nomad job directories. Directory sources require--source-directory, may specify--job-file-path, and may repeat--job-var-file-pathfor Nomad variable files. - Use
app-jobs destroyto 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-driftto 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:
nomatron app-jobs list --organization acme --app apiRead one job:
nomatron app-jobs read --organization acme --app api --job templateExamples
Create a template job:
nomatron app-jobs create \
--organization acme \
--app api \
--name "Template Service" \
--slug template \
--jobspec-path nomatron.tpl \
--jobspec-type TEMPLATECreate a job that uses its app repository:
nomatron app-jobs create \
--organization acme \
--app api \
--name "API Worker" \
--slug worker \
--jobspec-path jobs/worker.nomad.hcl \
--jobspec-type NOMADCreate a job with a repository override:
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-workerCreate a Nomad job from a directory with separate variable files:
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.jsonDirectory 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:
nomatron app-jobs update \
--organization acme \
--app api \
--job payments-worker \
--clear-repo-urlapp-jobs list and app-jobs read show the effective repository Nomatron will use for the job.
Set approval policy from a file:
nomatron app-jobs set-approval-policy \
--organization acme \
--app api \
--file ./approval-policy.jsonThe approval policy applies to the whole app, so set-approval-policy takes no --job flag.
Create a speculative plan:
nomatron app-jobs speculative-plan \
--organization acme \
--app api \
--job template \
--environment staging \
--ref feature/my-changeQueue an approvable plan:
nomatron app-jobs plan \
--organization acme \
--app api \
--job template \
--ref main \
--commit-sha abc123Queue a deploy plan with the clearer CI/operator command:
nomatron app-jobs deploy \
--organization acme \
--app api \
--job template \
--environment default \
--ref main \
--commit-sha abc123Promote to the next environment:
nomatron app-jobs promote --organization acme --app api --job templateList healthy rollback candidates in an environment, then create a rollback plan (defaults to the previous healthy release before the current head):
nomatron app-jobs rollback-candidates \
--organization acme \
--app api \
--job template \
--environment staging
nomatron app-jobs rollback \
--organization acme \
--app api \
--job template \
--environment stagingPass --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:
nomatron app-jobs destroy \
--organization acme \
--app api \
--job templateUse --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.