Skip to main content
Version: 0.15.1

Upgrading

Upgrading a build of your own is building the newer release and installing it over the earlier one, keeping everything else: your configuration, the install root and what it holds, every instance's state. It happens in four moments — stop and copy, build, replace, start again.

1. Stop, and copy​

A newer Core brings an instance's state to its own schema the first time it starts it, and the step does not run backwards: a store written by the newer Core is refused by the older one, naming both numbers. So stop what runs, so that nothing is executing the programs being replaced, and copy what you would want to go back to (copying an instance).

Note which instances run, stop each, and copy each — a copy is taken of a stopped instance, into a path that does not exist yet:

yoke instance list
bench-a com.example.station 2.1.0 observable
bench-b com.example.station 2.1.0 stopped
yoke instance stop bench-a
mkdir -p ~/yoke-backup
yoke instance copy bench-a ~/yoke-backup/bench-a

When the last instance stops, the account's guardian exits, so nothing of the old installation is left running.

2. Build the newer release​

Move the clone to the newer release's tag, and build it into ~/yoke-stage as building says, locally or in a container, with the packaging inputs beside the programs:

version=0.15.1
cd yoke
git fetch --tags
git checkout v$version

Check the version the new programs state before installing them, as building says: it is the new tag, without +dirty.

3. Replace​

Replace the programs and the guardian's unit with the new ones, from ~/yoke-stage. Your configuration and your install root stay as they are:

install -m 0755 ~/yoke-stage/yoke ~/yoke-stage/yoke-core ~/yoke-stage/yoke-guardian ~/yoke-stage/yoke-auth ~/.local/bin/
install -m 0755 ~/yoke-stage/yoke-compose ~/.local/bin/
sed "s|/usr/bin/yoke-guardian|$HOME/.local/bin/yoke-guardian|" ~/yoke-stage/packaging/yoke-guardian.service \
> ~/.config/systemd/user/yoke-guardian.service
systemctl --user daemon-reload

4. Start again​

Start again each instance you stopped, and check that it comes up:

yoke instance start bench-a
yoke instance list
bench-a com.example.station 2.1.0 observable
bench-b com.example.station 2.1.0 stopped

To go back, install the earlier release the same way, with its version, and restore the copy into an instance before starting it: yoke instance restore ~/yoke-backup/bench-a bench-a. A store the newer Core has written cannot be read by the older one; the copy is what makes going back possible.