diff --git a/rebuild_all.sh b/rebuild_all.sh index aa8bf3f..2717101 100755 --- a/rebuild_all.sh +++ b/rebuild_all.sh @@ -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 \ No newline at end of file