The website gets rollback too
The LED board got rollback a few days ago: if new firmware keeps crashing, the board goes back to the version that worked. Tonight the website caught up. Nothing changes on the screen, but how updates reach you changed a lot.
One home for all the code
Until now, every update traveled as a zip file. I'd download the latest copy, move it to the server, unzip it over the old one, and restart. It worked, but there was no history, no easy way back, and copies of the project ended up scattered across folders. One of those copies quietly disappeared from my laptop when the disk filled up and the cloud sync decided to stop keeping files on it.
So everything moved into a single private repository on GitHub: the website, the board firmware, the LED drawing code the board and the site share, and the Apple TV app. They live together on purpose. When the site learns a new kind of page, the TV app and the board have to learn it in the same change, or the new page shows up blank.
Every change is now saved with a note about what it does, so I can see exactly what changed and when. Board firmware releases get a label too, starting with 0.2.8.
Updates that ship themselves
The server now checks for new changes about once a minute and puts them live on its own. Before each update it:
- Backs up the database, so your collection is safe no matter what the update does. The last 10 backups are kept.
- Rebuilds the site with the new code.
- Checks that the site answers. If it doesn't come up within a minute and a half, the server puts the previous version straight back and skips that update, so a broken change can't take the site down for long.
Changes that only touch the board firmware or the Apple TV app are set up to skip the restart entirely.
A way back
If an update gets through but something about it is wrong, I can pick any earlier version from a list and put it live in about a minute. While an older version is up, automatic updates pause, so the server doesn't put the bad one right back. Picking the newest version again turns them back on.
What this means for you
Fixes reach you faster, the site is down for seconds during an update instead of minutes, and a bad update gets undone instead of sitting there until I notice. It also means I can work on the site from more than one computer without wondering which copy is the real one.