aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Hernandez <carlos@techbyte.ca>2020-08-30 17:13:41 +0000
committerCarlos Hernandez <carlos@techbyte.ca>2020-08-30 17:13:41 +0000
commit65b2fce78765649c64e7b7e0efbc99214fae0805 (patch)
treece7de684a577dd8adad87d50ab5456bd42fb1ac8
parent9c65017c3bfaecf51df5e746074d7ded9f942f05 (diff)
downloadrneovim-65b2fce78765649c64e7b7e0efbc99214fae0805.tar.gz
rneovim-65b2fce78765649c64e7b7e0efbc99214fae0805.tar.bz2
rneovim-65b2fce78765649c64e7b7e0efbc99214fae0805.zip
snap: don't run snapcraft under sudo
Snapcraft 4.0 complains about running LXD builds under sudo. So instead add the CI user to the "lxd" group and use sg to switch to that membership. Resolves: #12712
-rw-r--r--.travis.yml2
-rwxr-xr-xci/snap/install.sh1
-rwxr-xr-xci/snap/script.sh2
3 files changed, 4 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index b920f70f45..34ff492bb6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -193,6 +193,7 @@ jobs:
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
+ - SNAPCRAFT_BUILD_ENVIRONMENT: lxd
addons:
snaps:
- name: snapcraft
@@ -221,6 +222,7 @@ jobs:
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
+ - SNAPCRAFT_BUILD_ENVIRONMENT: lxd
fast_finish: true
before_install: ci/before_install.sh
diff --git a/ci/snap/install.sh b/ci/snap/install.sh
index 23e0bc5eb8..0ceb6f0422 100755
--- a/ci/snap/install.sh
+++ b/ci/snap/install.sh
@@ -4,6 +4,7 @@ set -e
set -o pipefail
sudo apt update
+sudo usermod -aG lxd $USER
sudo /snap/bin/lxd.migrate -yes
sudo /snap/bin/lxd waitready
sudo /snap/bin/lxd init --auto
diff --git a/ci/snap/script.sh b/ci/snap/script.sh
index 647cda4874..f0d45fea00 100755
--- a/ci/snap/script.sh
+++ b/ci/snap/script.sh
@@ -4,5 +4,5 @@ set -e
set -o pipefail
mkdir -p "$TRAVIS_BUILD_DIR/snaps-cache"
-sudo snapcraft --use-lxd
+sg lxd -c snapcraft