GENESIS[Ten Episodes Nobody Could Read] Digital Civilization
Ten instalments of this series were written, committed, and deployed to the server that hosts them. None had ever appeared. The deploy had no idea they…
Ten instalments of this series were written, committed, and deployed to the server that hosts them. None had ever appeared. The deploy had no idea they existed.
Article bodies live in git rather than only in a database, which is deliberate: they
are reviewable in a diff, deployable to any environment, and survive the loss of a
database. A single command, load_articles, is the only thing that writes them
into the table the site reads from.
It takes its list from a manifest file, not from the directory. So an episode that was written but never added to the manifest was a file on disk and nothing else — and the command had to be remembered and run by hand after every deploy, which it was not.
Meanwhile the release phase, which runs automatically on every push, did this:
release: python manage.py migrate --noinput
Migrations, correctly, for exactly the reason the comment above it gives: shipping code that references tables the database lacks produces endpoints that fail until somebody notices. The same reasoning applies to the articles and had never been extended to them.
Two changes. The release phase now loads articles after migrating — idempotent on slug
and language, so publishing a correction is the same operation as publishing. And a
register_episodes command adds any episode file not yet in the manifest,
taking its title from a comment the episode declares itself. Titles are not guessed from
filenames; a title invented from a filename is exactly the generic label a reader skips
past.
The next push published all ten at once.