Building snap on Gitlab CI / Docker

I’m trying to integrate snap building with Gitlab for continuous delivery. Internally it uses docker to run its jobs.

I’m using the snapcore/snapcraft:stable image to build the snap.

One odd thing I’ve found is that it wants Ubuntu 16 packages to be specified in snapcraft.yaml, despite it using core18.

That isn’t a big issue though, what is an issue is that I’m building a Qt app so I’m using the kde-neon extension and running snapcraft within the container fails with the following message:

property does not match the required schema: 'kde-neon' is not one of ['gnome-3-28']

Any way of fixing that?

Looks like stable tag hasn’t been updated in 9 months @sergiusens.

All of the snapcore/snapcraft images today are based on Xenial 16.04. I’d suggest copying the template @ https://hub.docker.com/r/snapcore/snapcraft/dockerfile and customize to meet your snap’s requirements (e.g. use Bionic 18.04).

but how do I get the kde-neon extension?

If you build a new image with that Dockerfile, it will include a current Snapcraft version, which will support kde-neon. The problem is that the stable image has a 9-month old version of Snapcraft that did not yet support kde-neon.

Seems to be working, I pushed the ubuntu 18 version to docker hub as mattbas/snapcraft:latest https://hub.docker.com/repository/docker/mattbas/snapcraft in case anyone else needs it.

You might have better luck with the images here:

That image publishes core, core18, and core20 tags providing environments matching each base snap.

1 Like