trivial: snap: pull from edge channel to build

Due to bug https://bugs.launchpad.net/snapcraft/+bug/1817300 snaps
using classic confinement began failing to build recently when
using docker.

This is also discussed in
https://forum.snapcraft.io/t/snap-build-started-failing-with-pip-not-working/10142/3

This commit can be reverted when snapcraft migrates to the stable
channel.

Fixes: #1041
This commit is contained in:
Mario Limonciello 2019-02-25 20:16:27 -06:00 committed by Mario Limonciello
parent b6baba5ce3
commit 6121eb26df
3 changed files with 38 additions and 7 deletions

View File

@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: cibuilds/snapcraft:stable
- image: superm1/snapcraft-edge:latest
steps:
- checkout
- run:

View File

@ -1,6 +1,25 @@
FROM snapcore/snapcraft
RUN mkdir /build
WORKDIR /build
COPY . .
RUN apt update
CMD ["./contrib/ci/snap.sh"]
FROM ubuntu:xenial
RUN apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install --yes \
curl sudo jq squashfs-tools && \
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap && \
mkdir -p /snap/core && unsquashfs -d /snap/core/current core.snap && rm core.snap && \
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=edge' | jq '.download_url' -r) --output snapcraft.snap && \
mkdir -p /snap/snapcraft && unsquashfs -d /snap/snapcraft/current snapcraft.snap && rm snapcraft.snap && \
apt remove --yes --purge curl jq squashfs-tools && \
apt-get autoclean --yes && \
apt-get clean --yes
COPY contrib/ci/snapcraft-wrapper /snap/bin/snapcraft
ENV PATH=/snap/bin:$PATH
LABEL maintainer="Mario Limonciello <mario.limonciello@dell.com>"
RUN apt-get update && apt-get install -y \
curl \
git \
jq \
openssh-client \
wget
WORKDIR /root/project

12
contrib/ci/snapcraft-wrapper Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
SNAP="/snap/snapcraft/current"
SNAP_NAME="$(awk '/^name:/{print $2}' $SNAP/meta/snap.yaml)"
SNAP_VERSION="$(awk '/^version:/{print $2}' $SNAP/meta/snap.yaml)"
SNAP_ARCH="amd64"
export SNAP
export SNAP_NAME
export SNAP_VERSION
export SNAP_ARCH
exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"