From 5efc3bbee2aeaf9f1e624c583228bc034333fa25 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 9 Jun 2020 22:00:15 +0100 Subject: [PATCH] snap: build fixes (#3990) * snap: drop sudo Fixes #3989 * snap: ci: fix builds * snap: ci: developer notifications * snap: minimise size * debug commit * Revert "snap: minimise size" This reverts commit 77b41a96f68b2c8df833803d0a644172b7db4779. * fix image info * Revert "debug commit" This reverts commit 232baf0ad78335b0f3806456a3f20b82cdf0f24c. * snap: v1 channels Related: #3872 --- .travis.yml | 6 +++++- scripts/build_snap.sh | 2 +- scripts/ci/before_install.sh | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0b14cc42..de7d7a517 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,8 +98,12 @@ jobs: - name: lxd channel: stable env: - - SNAPCRAFT_IMAGE_INFO: '{"build_url": "$TRAVIS_BUILD_URL"}' + - SNAPCRAFT_IMAGE_INFO: | + '{"build_url": "$TRAVIS_JOB_WEB_URL"}' + - SNAPCRAFT_BUILD_ENVIRONMENT: lxd + - SNAPCRAFT_BUILD_INFO: 1 # https://snapcraft.io/blog/introducing-developer-notifications-for-snap-security-updates install: + - sudo usermod --append --groups lxd $USER - sudo /snap/bin/lxd.migrate -yes - sudo /snap/bin/lxd waitready - sudo /snap/bin/lxd init --auto diff --git a/scripts/build_snap.sh b/scripts/build_snap.sh index 93e7d51cc..3d1ea8547 100755 --- a/scripts/build_snap.sh +++ b/scripts/build_snap.sh @@ -7,7 +7,7 @@ if [ ! -d "dvc" ]; then exit 1 fi -sudo snapcraft --use-lxd +sg lxd -c snapcraft pip uninstall -y dvc if which dvc; then diff --git a/scripts/ci/before_install.sh b/scripts/ci/before_install.sh index 1a02b3387..b16a58105 100644 --- a/scripts/ci/before_install.sh +++ b/scripts/ci/before_install.sh @@ -53,10 +53,10 @@ fi if [[ -n "$TRAVIS_TAG" ]]; then if [[ $(echo "$TRAVIS_TAG" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$') ]]; then - echo "export SNAP_CHANNEL=stable" >>env.sh + echo "export SNAP_CHANNEL=stable,v1/stable" >>env.sh else - echo "export SNAP_CHANNEL=beta" >>env.sh + echo "export SNAP_CHANNEL=beta,v1/beta" >>env.sh fi else - echo "export SNAP_CHANNEL=edge" >>env.sh + echo "export SNAP_CHANNEL=edge,v1/edge" >>env.sh fi