speed up rebuild_all

This commit is contained in:
Kay0u 2020-05-19 16:45:04 +02:00
parent 7af6cf3a37
commit 0cac5f87ab
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -5,8 +5,36 @@ source $current_dir/utils.sh # Get utils functions.
for debian_version in "stretch" "buster"
do
for ynh_version in "stable" "testing" "unstable"
# There is no stable and testing version for Buster at this time.
if [[ "$debian_version" == "buster" ]]
then
rebuild_base_containers $debian_version "unstable" "amd64"
else
rebuild_base_containers $debian_version "stable" "amd64"
for ynh_version in "testing" "unstable"
do
lxc launch "yunohost-$debian_version-stable" "yunohost-$debian_version-$ynh_version-tmp"
if [[ "$ynh_version" == "testing" ]]
then
repo_version="testing"
elif [[ "$DISTRIB" == "unstable" ]]
then
repo_version="testing unstable"
fi
lxc exec "yunohost-$debian_version-$ynh_version-tmp" -- /bin/bash -c "for FILE in \`ls /etc/apt/sources.list /etc/apt/sources.list.d/*\`;
do
rebuild_base_containers $debian_version $ynh_version "amd64"
done
sed -i 's@^deb http://forge.yunohost.org.*@& $repo_version@' \$FILE
done"
rotate_image "yunohost-$debian_version-$ynh_version-tmp" "yunohost-$debian_version-$ynh_version"
lxc delete -f "yunohost-$debian_version-$ynh_version-tmp"
update_image "yunohost-$debian_version-$ynh_version"
done
fi
done