From f05ee53ed171e5b782c5788df8f4d39ac0befd88 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 31 Jul 2020 16:09:14 +0200 Subject: [PATCH] Development is on buster by default now --- ynh-dev | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/ynh-dev b/ynh-dev index fe4a94a..50908e6 100755 --- a/ynh-dev +++ b/ynh-dev @@ -6,10 +6,10 @@ function show_usage() { ${BLUE}On the host, to manage the LXC${NORMAL} ${BLUE}==============================${NORMAL} - start [DIST] [NAME] (Create and) starts a LXC (DIST=stretch and NAME=ynh-dev by default) - attach [DIST] [NAME] Attach an already started LXC (DIST=stretch and NAME=ynh-dev by default) - destroy [DIST] [NAME] Destroy the ynh-dev LXC (DIST=stretch and NAME=ynh-dev by default) - rebuild [DIST] [NAME] Rebuild a fresh, up-to-date box (DIST=stretch and NAME=ynh-dev by default) + start [DIST] [NAME] (Create and) starts a LXC (DIST=buster and NAME=ynh-dev by default) + attach [DIST] [NAME] Attach an already started LXC (DIST=buster and NAME=ynh-dev by default) + destroy [DIST] [NAME] Destroy the ynh-dev LXC (DIST=buster and NAME=ynh-dev by default) + rebuild [DIST] [NAME] Rebuild a fresh, up-to-date box (DIST=buster and NAME=ynh-dev by default) ${BLUE}Inside the dev instance${NORMAL} ${BLUE}=======================${NORMAL} @@ -132,7 +132,7 @@ function start_ynhdev() { check_lxd_setup - local DIST=${1:-stretch} + local DIST=${1:-buster} local BOX=${2:-ynh-dev}-${DIST} if ! sudo lxc info $BOX &>/dev/null @@ -142,10 +142,7 @@ function start_ynhdev() set -x sudo lxc launch $BOX-base $BOX sudo lxc config set $BOX security.privileged true - if [[ "$DIST" == "buster" ]] - then - sudo lxc config set $BOX security.nesting true # Need this for buster because it is using apparmor - fi + sudo lxc config set $BOX security.nesting true # Need this for apparmor for some reason sudo lxc config device add $BOX ynhdev-shared-folder disk path=/ynh-dev source="$(readlink -f $(pwd))" set +x info "Now attaching to the container" @@ -170,7 +167,7 @@ function attach_ynhdev() fi check_lxd_setup - local BOX=${1:-ynh-dev-stretch} + local BOX=${1:-ynh-dev-buster} sudo lxc start $BOX 2>/dev/null || true sudo lxc exec $BOX --cwd /ynh-dev -- /bin/bash } @@ -178,7 +175,7 @@ function attach_ynhdev() function destroy_ynhdev() { check_lxd_setup - local DIST=${1:-stretch} + local DIST=${1:-buster} local BOX=${2:-ynh-dev}-${DIST} sudo lxc stop $BOX sudo lxc delete $BOX @@ -188,26 +185,18 @@ function rebuild_ynhdev() { check_lxd_setup - local DIST=${1:-stretch} + local DIST=${1:-buster} local BOX=${2:-ynh-dev}-${DIST} set -x sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force sudo lxc launch images:debian/$DIST/amd64 $BOX-rebuild sudo lxc config set $BOX-rebuild security.privileged true - if [[ "$DIST" == "buster" ]] - then - sudo lxc config set $BOX-rebuild security.nesting true # Need this for buster because it is using apparmor - fi + sudo lxc config set $BOX-rebuild security.nesting true # Need this for apparmor for some reason sudo lxc restart $BOX-rebuild sleep 5 sudo lxc exec $BOX-rebuild -- apt install curl -y - if [[ "$DIST" == "buster" ]] - then - INSTALL_SCRIPT="https://raw.githubusercontent.com/YunoHost/install_script/buster-unstable/install_yunohost" - else - INSTALL_SCRIPT="https://install.yunohost.org" - fi + INSTALL_SCRIPT="https://install.yunohost.org" sudo lxc exec $BOX-rebuild -- /bin/bash -c "curl $INSTALL_SCRIPT | bash -s -- -a -d unstable" sudo lxc stop $BOX-rebuild sudo lxc publish $BOX-rebuild --alias $BOX-base