Fix clean and rebuild

This commit is contained in:
Kay0u 2020-03-26 18:12:20 +01:00
parent c44b1a4bef
commit bfb074378f
No known key found for this signature in database
GPG key ID: 7FF262C033518333
2 changed files with 9 additions and 7 deletions

View file

@ -5,8 +5,6 @@ for debian_version in "stretch" "buster"
do do
for ynh_version in "stable" "testing" "unstable" for ynh_version in "stable" "testing" "unstable"
do do
base_image="yunohost-$debian_version-$ynh_version" rebuild_base_containers $debian_version $ynh_version "amd64"
rebuild_base_containers $base_image
done done
done done

View file

@ -11,7 +11,7 @@ clean_containers()
do do
if lxc info $image_to_delete &>/dev/null if lxc info $image_to_delete &>/dev/null
then then
lxc delete $base_image_to_clean --force lxc delete $image_to_delete --force
fi fi
done done
@ -46,10 +46,14 @@ wait_container()
rebuild_base_containers() rebuild_base_containers()
{ {
local base_image_to_rebuild=$1 local debian_version=$1
local ynh_version=$2
local arch=$3
local base_image_to_rebuild="yunohost-$debian_version-$ynh_version"
clean_containers $base_image_to_rebuild clean_containers $base_image_to_rebuild
lxc launch images:debian/$DEBIAN_VERSION/$ARCH "$base_image_to_rebuild-tmp" lxc launch images:debian/$debian_version/$arch "$base_image_to_rebuild-tmp"
wait_container "$base_image_to_rebuild-tmp" wait_container "$base_image_to_rebuild-tmp"
@ -70,7 +74,7 @@ rebuild_base_containers()
wait_container "$base_image_to_rebuild-tmp" wait_container "$base_image_to_rebuild-tmp"
# Install yunohost # Install yunohost
lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl https://install.yunohost.org | bash -s -- -a -d $CURRENT_VERSION" lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "curl https://install.yunohost.org | bash -s -- -a -d $ynh_version"
lxc stop "$base_image_to_rebuild-tmp" lxc stop "$base_image_to_rebuild-tmp"
# Create image before postinstall # Create image before postinstall