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.
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The job's name, unique within the project. Deploying an existing name replaces that job. Stick to letters, digits, - and _. |
driver | string | yes | The runtime: node, python or go. See Writing jobs. |
cmd | string | yes | Shell command that runs the job, executed with sh -c in the job's directory. |
install | string | no | Shell command run before cmd on every run, for example npm ci or pip install -r requirements.txt. If it fails, cmd doesn't run. |
build | string | no | Shell command the CLI runs on your machine before packaging, for example npm run build. Not sent to the runner. |
includes | string[] | yes, in practice | The files and directories to upload. See Packaging. |
secrets | string[] | no | Names of project secrets to pass to the job as environment variables. Only declared secrets are passed. |
params | string[] | no | Names of the parameters the job accepts. Shown in the dashboard; not enforced (see below). |
schedule | string | no | Cron expression, evaluated in UTC. See Scheduling. |
Notes:
- Keys are matched case-insensitively. Unknown keys are ignored silently, so check spelling.
- Names in
secretsandparamscan't start withAPERTURE_; that prefix is reserved for platform variables. - Omitted fields are cleared on redeploy.
paramsis 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 entry | What 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/jobsrun and triggers also read the local job.json to get the job's name.