diff --git a/snap/local/build_and_install.sh b/snap/local/build_and_install.sh index 4c9754d3e..f103477f1 100755 --- a/snap/local/build_and_install.sh +++ b/snap/local/build_and_install.sh @@ -6,9 +6,15 @@ if [[ -z "$TRAVIS" ]]; then exit 1 fi +# Add the current user to the lxd group so they can run `snapcraft --use-lxd` +# without sudo since running the command without sudo is required by newer +# versions of snapcraft. +sudo usermod -aG lxd "$USER" sudo /snap/bin/lxd.migrate -yes sudo /snap/bin/lxd waitready sudo /snap/bin/lxd init --auto tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt > constraints.txt -sudo snapcraft --use-lxd +# Run snapcraft with the lxd group since it has not been added to the current +# shell. +sg lxd -c 'snapcraft --use-lxd' sudo snap install --dangerous --classic *.snap