Configuration
cactive.json
Serverless App Service configuration that lives in your repository.
Where it goes
Put cactive.json in the Serverless App Service's root directory: the repository root, or the folder set as Root Directory in the Serverless App Service's settings. The build saves it with the deployment, so each deployment carries the configuration of its commit.
si.json, the file's former name, still works: when the root directory has no cactive.json, the platform reads si.json instead, and Cloud's settings and the build log suggest renaming it. When both exist, cactive.json decides.
Reference
{
"watch": ["packages/ui/**", "tsconfig.base.json"],
"crons": [
{ "path": "/api/cron/daily-report", "schedule": "cron(0 9 * * ? *)" },
{ "path": "/api/cron/sync", "schedule": "rate(15 minutes)" }
]
}| Key | Type | |
|---|---|---|
watch | array of strings | Paths outside the root directory whose changes also build this Serverless App Service, and ! paths whose changes don't. See watch. |
crons | array | Requests the platform makes to your production deployment on a schedule. See Crons. |
crons[].path | string | The path to call. Must start with /. |
crons[].schedule | string | A rate(…) or cron(…) expression (syntax). |
checks | array of strings | Scripts Caity runs when it checks a branch (repository root cactive.json), e.g. ["typecheck", "test"]. Default: whichever of typecheck, lint, test and build package.json defines. |
watch, crons and checks are the only keys the platform reads; anything else in the file is ignored.
watch
A push builds a Serverless App Service when it changes a file under the Serverless App Service's root directory or an install file above it; otherwise the push is skipped. watch adds more paths, typically shared code in a monorepo:
{ "watch": ["packages/ui/**", "packages/config/src/*.ts"] }- Patterns are relative to the repository root, not the root directory. A leading
./or/is ignored. **matches any number of folders,*and?match within one folder name, and everything else is literal.- A pattern that matches a folder also matches everything inside it:
packages/uicoverspackages/ui/src/button.tsx. - A pattern starting with
!drops matching paths, inside the root directory too, so changes that never affect the build don't build it:["packages/ui/**", "!**/*.test.*", "!**/README.md"]. The root directory'scactive.jsonand install files always count. - Patterns over 200 characters are ignored; up to 50 are used.
- The
cactive.jsonof the pushed commit decides.
Crons validation
- Entries whose
pathdoesn't start with/, or whosescheduleisn'trate(…)orcron(…), are skipped. - Only the first 20 crons are used.
- A file that isn't valid JSON counts as having no crons.
- An expression the scheduler rejects (such as
rate(5 mins)) fails a production deployment when it's applied. Previews only record their crons, so they don't catch it.
When crons take effect
A deployment's crons apply when it becomes production: when a production deployment is ready, and when you promote or roll back to it. Preview deployments record their crons but don't run them.
A production deployment without cactive.json, or without crons, removes the Serverless App Service's schedules.