Skip to Content
Aperture

Job manifest (job.json)

Every field of job.json, what reads it, and how files are packaged.

Each job directory contains a job.json that describes how to package and run the job.

jobs/nightly-report/job.json
{
  "name": "nightly-report",
  "driver": "node",
  "build": "npm run build",
  "install": "npm ci --omit=dev",
  "cmd": "node dist/index.js",
  "includes": ["dist", "package.json", "package-lock.json"],
  "secrets": ["SLACK_WEBHOOK_URL"],
  "params": ["REPORT_DATE"],
  "schedule": "0 6 * * *"
}

Fields

FieldTypeRequiredDescription
namestringyesThe job's name, unique within the project. Deploying an existing name replaces that job. Stick to letters, digits, - and _.
driverstringyesThe runtime: node, python or go. See Writing jobs.
cmdstringyesShell command that runs the job, executed with sh -c in the job's directory.
installstringnoShell command run before cmd on every run, for example npm ci or pip install -r requirements.txt. If it fails, cmd doesn't run.
buildstringnoShell command the CLI runs on your machine before packaging, for example npm run build. Not sent to the runner.
includesstring[]yes, in practiceThe files and directories to upload. See Packaging.
secretsstring[]noNames of project secrets to pass to the job as environment variables. Only declared secrets are passed.
paramsstring[]noNames of the parameters the job accepts. Shown in the dashboard; not enforced (see below).
schedulestringnoCron expression, evaluated in UTC. See Scheduling.

Notes:

  • Keys are matched case-insensitively. Unknown keys are ignored silently, so check spelling.
  • Names in secrets and params can't start with APERTURE_; that prefix is reserved for platform variables.
  • Omitted fields are cleared on redeploy.
  • params is informational. Runs may pass params that aren't declared, and declared params may be missing. Read them with a default in your code.

Packaging

The CLI walks the job directory and adds a file or directory to the zip when:

  • its name (not path) matches an entry in includes, at any depth, or
  • it is inside a directory that matched.
includes entryWhat it adds
"dist"The dist/ directory and everything in it.
"main.py"Every file named main.py, at any depth.
"package.json"./package.json, and any nested package.json, including inside node_modules if it exists locally.
"src/index.ts"Nothing: entries containing / never match.

There are no globs and no default exclusions (.gitignore is ignored). job.json itself is only uploaded if you list it. If nothing matches, the deploy stops with No files were included.

The archive's contents become the job's working directory, /work, at run time.

Where the CLI looks for job.json

aperture-cli deploy <job> reads <current dir>/jobs/<job>/job.json. Change the base directory with --path:

aperture-cli deploy nightly-report             # ./jobs/nightly-report/job.json
aperture-cli deploy nightly-report --path .    # ./nightly-report/job.json
aperture-cli deploy nightly-report --path services/jobs

run and triggers also read the local job.json to get the job's name.

On this page