Skip to content

scaffold

Creates the folder structure and starter files for a new alert.

Usage

Terminal window
orwell scaffold [options]

Options

FlagAliasDefaultDescription
--name <name>-n(required)Alert name
--group-name <group>-galert-groupGroup folder name
--base-dir <dir>srcBase directory for alerts
--dest <dir>.Destination directory
--no-gitSkip git init

What it creates

<dest>/
<base-dir>/
<group-name>/
<name>/
watcher.non-prod.json ← starter watcher definition
script.groovy ← references shared script
shared/
shared.groovy ← shared Painless code

script.groovy comes pre-wired with an #include pointing at shared/shared.groovy:

#include "../../shared/shared.groovy"
// your Painless logic here

Examples

Default group name

Terminal window
orwell scaffold --name order-failure

Creates src/alert-group/order-failure/.

Custom group

Terminal window
orwell scaffold --name order-failure --group-name payments

Creates src/payments/order-failure/.

Different base directory and destination

Terminal window
orwell scaffold --name order-failure -g payments --base-dir alerts --dest /tmp/my-project

Skip git init

Useful when adding an alert to an existing repository:

Terminal window
orwell scaffold --name order-failure --no-git