seed
engine-dmo seed: Seed sets: validated content with history, assets and generated analytics. Every subcommand, argument and flag.
Seed sets: validated content with history, assets and generated analytics.
| Command | What it does |
|---|---|
engine-dmo seed apply | Apply a seed set through the same validation and revision machinery as an editor |
engine-dmo seed generate | Generate documents of a type whose values pass each field’s validation, from seeded word lists and placeholder images |
engine-dmo seed list | Available seed sets and what they contain |
engine-dmo seed reset | Remove all content, media and analytics; keep users and configuration |
engine-dmo seed verify | Check the seed set loads and matches the current schema (the CI check) |
engine-dmo seed write | Write the seed set’s generated records from seed/generate.yaml, or with --check report how the files differ from it |
engine-dmo seed apply
Apply a seed set through the same validation and revision machinery as an editor.
engine-dmo seed apply [flags] | Flag | Type | Default | Meaning |
|---|---|---|---|
--i-know-what-i-am-doing | bool | allow seeding an empty production database | |
--profile | string | apply only a profile of seed.yaml’s profiles, with everything it depends on | |
--scale | string | small | small | medium | large, scales the generated analytics |
--set | string | seed set directory name under seed/ (default: seed/ itself) | |
--timeout | duration | 30m0s | give up after this long; a seed with thousands of assets against a remote database can need more |
--json prints the text output in the JSON envelope. Runs in a project.
engine-dmo seed generate
Generate documents of a type whose values pass each field’s validation, from seeded word lists and placeholder images.
engine-dmo seed generate [flags] | Flag | Type | Default | Meaning |
|---|---|---|---|
--count | int | 10 | how many documents |
--locale | string | locale (default: the source locale) | |
--near | string | latitude,longitude that generated points fall around, where a field has no bounds of its own | |
--publish | bool | publish each document through the publish checks | |
--seed | int64 | 1 | the generator’s seed; the same seed over the same database gives the same values |
--site | string | owner site (default: the default site) | |
--type | string | type key |
--json prints the command’s own JSON document. Runs in a project.
engine-dmo seed list
Available seed sets and what they contain.
engine-dmo seed list --json prints the text output in the JSON envelope. Runs in a project.
engine-dmo seed reset
Remove all content, media and analytics; keep users and configuration.
engine-dmo seed reset [flags] | Flag | Type | Default | Meaning |
|---|---|---|---|
--confirm | bool | confirm the reset |
--json prints the text output in the JSON envelope. Runs in a project.
engine-dmo seed verify
Check the seed set loads and matches the current schema (the CI check)
engine-dmo seed verify [flags] | Flag | Type | Default | Meaning |
|---|---|---|---|
--profile | string | verify only a profile, with everything it depends on | |
--set | string | seed set directory name under seed/ |
--json prints the text output in the JSON envelope. Runs in a project.
seed verify never connects to the database, but it loads the whole configuration, so DATABASE_URL and every other variable without a default must be set, a placeholder will do (see Commands and the environment).
Matches the schema is not proof the seed applies
seed verify checks that the set loads, and that every type, field and locale it names exists. It does not validate field values: a select value that is not an option, or a number below the field’s min, passes with Matches the schema. seed apply validates every value as an editor’s save does and refuses the first bad one (seed/documents/page/home.yaml: publish en refused: distanceKm: Must be 0 or more). To prove a seed, apply it to a scratch database.
engine-dmo seed write
Write renders the content spec beside seed.yaml (generate.yaml) into ordinary seed files, each
marked as generated, and removes the generated files the spec no longer makes. Hand-written files are
never touched. The same spec writes the same files on every machine.
Placeholders a recipe may use:
{$var}
a let variable, or $n, $index, $count, $key, $locale
{pick LIST}
a word from a list, the same position in every locale's list
{lookup LIST KEYS KEY}
the word of LIST at the position KEY has in the list KEYS, in the locale: a place's name from its key
{at VALUE KEY}
one key of a mapping value, such as a let variable holding a route
{route PLACE KM [N] [loop|line] [LOW] [HIGH] [LABEL]}
a walk's route near a place: start, points (point, km, elevationM), km, minutes, length (short, medium, long), ascent, highest, lowest and corridor, the box around it
{pickn LIST N [M]}
N to M different words from a list, as a list
{uniq LIST}
a word no other record of the recipe drew here, until the list runs out: for names
{nth LIST}
the word at the record's own position in a list, the same position in every locale's list: a record's name and its place together
{phrase NAME}
a sentence pattern from phrases, in the locale, its placeholders rendered
{sentences NAME N [M]}
N to M patterns of NAME, joined with spaces
{pt NAME N [M]}
Portable Text: N to M paragraphs, each two or three patterns of NAME
{slug X}
X as a slug
{lower X | upper X | cap X}
X in lower case, upper case, or with a capital first letter
{int A B}
a whole number from A to B
{float A B [DP]}
a number from A to B, rounded to DP places (default 1)
{chance P}
true for a share P of records
{oneof A B C}
one of the words given
{eq A B | not A | and A B... | or A B... | if C A B}
conditions for ?$var keys: equal, not, all, any, and A when C is true else B
{cycle A B C}
the words in turn by record, so each is used evenly
{n | index | count}
the record's number from 1, from 0, and the recipe's count
{point [PLACE]}
{lat, lon} inside a place's radius, or inside bounds
{polygon PLACE [KM]}
a GeoJSON polygon around a place
{photo CATEGORY [ORIENTATION]}
{asset: key} of a photograph from the index
{photokey CATEGORY [ORIENTATION]}
a photograph's key alone
{photos CATEGORY N [M]}
a list of N to M photographs, as asset items
{video POSTER_CATEGORY [TITLE_PHRASE [TRANSCRIPT_PHRASE]]}
a video field value from the pool with a title, a start time, a poster and a transcript
{ref RECIPE | refnth RECIPE}
a key of another recipe's record: any, or the one with this record's number
{relation RECIPE | relationnth RECIPE}
{id, type} of another recipe's document
{relations RECIPE N [M]}
a list of N to M different relations
{relationsby RECIPE PATH VALUE N [M]}
N to M different relations to RECIPE's records whose rendered PATH (locales.en-GB.area, or area, read in the source locale) names VALUE, such as $key: a village's own listings
{date A B}
a seed date from A to B days from the day of applying, such as +12d
{absdate A B | abstime A B HH:MM}
an absolute date or wall clock A to B days from the spec's anchor
{digits PATTERN}
PATTERN with each # a digit: 01632 ### ###
{data NAME | pickdata NAME | nthdata NAME}
a value from data, whole, one item of a list, or the item at the record's own position
{locales}
the locales this record is written in, the source first
{omit}
leave this key or item out engine-dmo seed write [flags] | Flag | Type | Default | Meaning |
|---|---|---|---|
--check | bool | write nothing; exit 3 when the files differ from the spec | |
--set | string | seed set directory name under seed/ |
--json prints the text output in the JSON envelope. Runs in a project.