wekan/releases/snap-build.sh
Lauri Ojansivu f8e576e890
Some checks failed
Docker / build (push) Has been cancelled
Docker Image CI / build (push) Has been cancelled
Release Charts / release (push) Has been cancelled
Test suite / Meteor tests (push) Has been cancelled
Test suite / Coverage report (push) Has been cancelled
Try to fix Snap.
Thanks to xet7 !
2025-11-02 22:23:16 +02:00

49 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
echo "First run: snapcraft login"
echo "Then run this script"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Linux"
#
# a) For VirtualBox,
# at /etc/modprobe.d/blacklist.conf blacklist these: (or kvm_amd)
# blacklist kvm_intel
# blacklist kvm
#
# b) For kvm, snapcraft.io/multipass and waydroid,
# at /etc/modprobe.d/blacklist.conf do not blacklist these:
# # blacklist kvm_intel
# # blacklist kvm
#
# If firewall is enabled, building snap does not work
sudo ufw disable
sudo apt-get -y install snapd
sudo systemctl enable snapd
sudo systemctl start snapd
sudo snap install snapcraft --classic
sudo snap install multipass
sudo snap install lxd
lxd init --auto
multipass delete ubu
multipass purge
multipass launch --name ubu
snapcraft pack
sudo ufw enable
exit;
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS"
brew install snapcraft
brew install multipass
# Launch multipass VM if needed
if ! multipass list | grep -q "ubu.*Running"; then
multipass launch --name ubu
fi
# Build with platform specified for macOS
snapcraft pack --use-lxd --platform=amd64 --build-for=amd64
exit;
else
echo "Unknown OS: $OSTYPE"
echo "Please install snapcraft and multipass manually."
exit;
fi