We’ve four snaps based on Mir to manage and, over the last day, @saviq and I have been trying to get some consistency and automation into the way we manage them.
To recap, these are the snaps:
mir-kiosk is our recommended solution for IoT use-cases
mir-test-tools is a snap of the tests and tools we’ve found useful for proving Mir works on various devices
egmde is a Mir based “desktop environment”. Unlike the other snaps we maintain it is a
classic snap and will not install on Ubuntu Core
egmde-confined-desktop is also a Mir based “desktop environment”, but is an experiment to determine the limitations and possibilities of a fully
Typically, we build each of these snaps with the current release (or release candidate) of Mir and also with the latest development “master” branch.
Managing automated snap builds
We use launchpad “snap recipes” to build these snaps. We use Launchpad directly, not through the snapcraft build tools as this allows us to specify source of the Mir libraries to use (either ppa:mir-team/rc or ppa:mir-team/dev).
We also needed a way to determine if the version of Mir in the snap is up to date with the version of egmde (where appropriate), Mir and the snap packaging. To do that we use the
version string in the snap as follows:
[<server-version>-mir]<mir-version>[-snap<snap-version>. Like this:
Here “1.1.2” (or “1.1.2+dev168”) is the current Mir version (release or development), “82” is the egmde version and “snap18” is the version of the snapcraft packaging.
Generating these version numbers isn’t quite trivial, the snap packaging for each snap has some variant of the following:
sudo apt --assume-yes install software-properties-common
sudo add-apt-repository -yu ppa:mir-team/release
git rev-list --count HEAD > $SNAPCRAFT_PART_INSTALL/recipe-version
after: [ppa-mir, recipe-version]
server_version=`git rev-list --count HEAD`
mir_version=`LANG=C apt-cache policy mir-graphics-drivers-desktop | sed -rne 's/^\s+Candidate:\s+([^-]*)-.+$/\1/p'`
snapcraftctl set-version $server_version-mir$mir_version-snap$recipe_version
if echo $mir_version | grep dev; then snapcraftctl set-grade devel; else snapcraftctl set-grade stable; fi
The final piece that pulls this all together is a script that runs in ci. This checks each of the snaps version strings against the contents of corresponding PPAs. That gets an automated build of the snap to the
edge (for devel, and
candidate (for release).
Humans still required
The final stage of promotion to
stable still takes a manual review.