Updating the engine

Getting started — part 10 of 10

git pull
./blog.sh rebuild

rebuild, not ruby build/build_blog.rb: the build script renders one language per run, and rebuild runs it for every language the site publishes and then deploys. On a site in two languages the bare script followed by a deploy leaves the second language's pages as the previous version built them -- and uploads them that way.

main is the release branch: a clone on it gets each release by git pull. A clone that was put on a release tag (git checkout v1.10) is on no branch, and git pull refuses with "You are not currently on a branch"; move it to the next release by name instead:

git fetch --tags && git checkout v1.12.1

./blog.sh doctor --online says when a newer release is out, and which of the two to run: it reads the release tags from origin (nothing is fetched or written) and compares the newest with the engine's own version. A clone on a branch of its own hears the two numbers and no command, and a copy that is not a git clone is not checked.

The first build after an upgrade may be a full one -- the engine's own fingerprint changed, so the record of the last build is thrown away -- and it writes .build_cache.json in the installation directory -- on a site of several languages one .build_cache-<hash>.json for each of them -- which is per-machine, gitignored and always safe to delete. Deploy the assets with it: a page that cannot fetch assets/js/share.js logs a 404 on every load. From 1.10 to 1.11 that first deploy uploads every page, once: each link to a stylesheet or a script now carries a fingerprint of the file (?v=), so a returning reader is never handed a new page with yesterday's stylesheet -- and every later change to one does the same. The same deploy takes /write/ off the site, so a post that links to it now leads to a 404; ./blog.sh check names each one (link_dead). From 1.11.1 to 1.12 the first deploy uploads every page once more: the stylesheet and the comment script changed, and with them their fingerprints. A post with a toot also carries the words of the field for the reader's own server, and nothing else in a page changes. From 1.12 to 1.12.1 no page changes at all.

Going back a version is git checkout <tag> and a rebuild, and what the newer version was given to work with is looked at first, because the older one does not treat all of it alike. From 1.12.1 back to 1.12 there is nothing to look at. From 1.12 back to 1.11.1 nothing stops the build. comments.reply_from_own_server it passes over, and the field for the reader's own server leaves the pages. A toot that waits in .announce-pending is never sent: send it with ./blog.sh toot <slug> (or bluesky) first. The TRANSLATOR_* lines in env.sh it ignores, and --auto is a word translate does not know. A translation 1.12 wrote into tmp/ and nobody has saved carries a base: that 1.11.1 reads as "the post changed since", so add refuses it -- save it before going back. Hashtags go back to their old shape, and a site with no deploy target is announced again. From 1.11 back to 1.10: take series_index: out of every config/site.<lang>.yml, or the build stops on it and nothing is deployed. A menu entry that names a series (series:) or heads a group (group: true) 1.10 leaves out of the menu, with a line in the build and an error in doctor for each -- a chapter can lead to its listing by url: "/series/<slug>/" instead. site.skin, layout.series_contents and series_index: in site.yml it passes over without a word: the site wears classic again, and skins/ goes with the checkout. The pages ask for their stylesheets and scripts by the bare address again, so the deploy after that first build uploads every page. write: true, where it is still in site.yml, publishes /write/ again. What 1.11 left in the installation folder for itself, tmp/pairing/seen/, is safe to delete.

From 1.10 back to 1.9: take series: and language_name: out of every config/site.<lang>.yml, or the build stops on them and nothing is deployed -- a language's file is where 1.9 refuses a key it does not know. on_this_day under widgets: it does not refuse: the build says one line about it, doctor marks it, and the card is simply not drawn. And site.author_name, banner.show_image, layout.lead_card and publishing.allow_partial it passes over without a word, so the pages go back to what 1.9 makes without them -- the banner's picture is shown again, for one, and a site of several languages is asked about every post again. Old addresses a translation was given (translations.<lang>.former_slugs) stop being answered -- 1.9 does not read them, and a translation saved there is written without the list, so those addresses are not in the post on the way forward again either. What 1.10 left in the installation folder for itself (.on-this-day.*.json, .search_index.json, .last-sidebar-run, tmp/pairing/) is safe to delete. The apps stop reaching the blog: the door they come through, scripts/remote.sh, is new in 1.10 and 1.9 does not have it. A line ./blog.sh pair wrote into ~/.ssh/authorized_keys (it ends blog.sh:<device>) then points at nothing -- take it out by hand. Either step, the posts, the media and the rest of the configuration are otherwise untouched in both directions.

Per-deployment files (content.nosync/, media.nosync/, config/site.yml, config/site.<lang>.yml, env.sh, incoming/, trash/, drafts/, manifests) are gitignored and survive any pull untouched. The one thing to watch: if you've edited engine files in place (templates, CSS), a pull can conflict -- keep such customizations as commits on your own branch so git merges them for you. config/palettes.yml is one of those: it ships with the engine, so a palette of your own added to it is an edit in place. The wizards also leave a .bak of whatever they rewrote -- config/site.yml.bak, env.sh.bak -- which is how you take a wizard run back by hand. Nothing deletes them, and the env.sh one holds your previous tokens at the same 0600, so remove it once you have rotated a token.