Browse Source

Update LXD build script (#3347)

* Add missing new OS remove the old

* Update versions and use /deb/ instead of /debs/

* Use snapd instead
Jaap Marcus 3 years ago
parent
commit
4f1283052f
2 changed files with 10 additions and 7 deletions
  1. 6 3
      src/lxd_build_all.sh
  2. 4 4
      src/lxd_compile.sh

+ 6 - 3
src/lxd_build_all.sh

@@ -13,7 +13,8 @@
 #
 #
 
 
 # Configs:
 # Configs:
-oslist=('debian=9,10' 'ubuntu=18.04,20.04')
+# Use focal and jammy instead of "20.04 an 22.04"
+oslist=('debian=10,11' 'ubuntu=18.04,focal,jammy')
 branch='main'
 branch='main'
 
 
 function setup_container() {
 function setup_container() {
@@ -42,8 +43,10 @@ if [ -z "$user" ] || [ -z "$user_id" ] || [ -z "$user_gid" ] || [ "$user" = 'roo
 	echo "Script must be run with sudo, not directly as root" && exit 1
 	echo "Script must be run with sudo, not directly as root" && exit 1
 fi
 fi
 
 
-if ! dpkg-query -s lxd > /dev/null 2>&1; then
-	apt -y install lxd
+if ! which lxd > /dev/null 2>&1; then
+	# Use snapd instead
+	apt -y install snapd
+	snap install lxd
 	lxd init --auto
 	lxd init --auto
 
 
 	echo "root:$user_id:1" | sudo tee -a /etc/subuid
 	echo "root:$user_id:1" | sudo tee -a /etc/subuid

+ 4 - 4
src/lxd_compile.sh

@@ -4,22 +4,22 @@ branch=${1-main}
 
 
 apt -y install curl wget
 apt -y install curl wget
 
 
-curl https://raw.githubusercontent.com/hestiacp/hestiacp/main/src/hst_autocompile.sh > /tmp/hst_autocompile.sh
+curl https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/hst_autocompile.sh > /tmp/hst_autocompile.sh
 chmod +x /tmp/hst_autocompile.sh
 chmod +x /tmp/hst_autocompile.sh
 
 
 mkdir -p /opt/hestiacp
 mkdir -p /opt/hestiacp
 
 
 # Building Hestia
 # Building Hestia
 if bash /tmp/hst_autocompile.sh --hestia --noinstall --keepbuild $branch; then
 if bash /tmp/hst_autocompile.sh --hestia --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi
 fi
 
 
 # Building PHP
 # Building PHP
 if bash /tmp/hst_autocompile.sh --php --noinstall --keepbuild $branch; then
 if bash /tmp/hst_autocompile.sh --php --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi
 fi
 
 
 # Building NGINX
 # Building NGINX
 if bash /tmp/hst_autocompile.sh --nginx --noinstall --keepbuild $branch; then
 if bash /tmp/hst_autocompile.sh --nginx --noinstall --keepbuild $branch; then
-	cp /tmp/hestiacp-src/debs/*.deb /opt/hestiacp/
+	cp /tmp/hestiacp-src/deb/*.deb /opt/hestiacp/
 fi
 fi