Development is on buster by default now

This commit is contained in:
Alexandre Aubin 2020-07-31 16:09:14 +02:00
parent 940ba0e541
commit f05ee53ed1

31
ynh-dev
View file

@ -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
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