From 954ccb373cafc71e26d66f4f38e751cc621b1812 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 19 May 2020 17:48:31 +0200 Subject: [PATCH] fix rebuild all --- base.sh | 5 ----- rebuild_all.sh | 33 ++++++++++++++++++--------------- utils.sh | 11 +++++++++++ 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/base.sh b/base.sh index d955a69..bf6f3ed 100755 --- a/base.sh +++ b/base.sh @@ -23,8 +23,3 @@ PROJECT_NAME="$CUSTOM_ENV_CI_PROJECT_NAME" # For example yunohost-stretch-unstable BASE_IMAGE="yunohost-$DEBIAN_VERSION-$CURRENT_VERSION" - - -YNH_DEPENDENCIES="apt apt-transport-https apt-utils avahi-daemon bind9utils ca-certificates cron curl debhelper dnsmasq dnsutils dovecot-antispam dovecot-core dovecot-ldap dovecot-lmtpd dovecot-managesieved equivs fail2ban fake-hwclock git haveged inetutils-ping iproute2 iptables jq ldap-utils libconvert-asn1-perl libdbd-ldap-perl libestr0 libfastjson4 libgssapi-perl libjq1 liblogging-stdlog0 liblognorm5 libmcrypt4 libnet-ldap-perl libnss-ldapd libnss-mdns libnss-myhostname libonig4 libopts25 libpam-ldapd libyaml-0-2 logrotate lsb-release lsof lua5.1 lua-bitop lua-event lua-expat lua-filesystem lua-json lua-ldap lua-lpeg lua-rex-pcre lua-sec lua-socket lua-zlib mailutils mariadb-server netcat-openbsd nginx nginx-extras ntp opendkim-tools openssh-server openssl php7.0-curl php7.0-gd php7.0-mbstring php7.0-mcrypt php7.0-xml php-curl php-fpm php-gd php-gettext php-intl php-ldap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pear php-php-gettext php-xml postfix postfix-ldap postfix-pcre postfix-policyd-spf-perl postsrsd procmail python-argcomplete python-bottle python-dbus python-dnspython python-gevent python-gevent-websocket python-greenlet python-jinja2 python-ldap python-miniupnpc python-openssl python-packaging python-psutil python-publicsuffix python-requests python-toml python-tz python-yaml redis-server resolvconf rspamd rsyslog slapd sudo-ldap unattended-upgrades unscd unzip wget whois" -BUILD_DEPENDENCIES="git-buildpackage postfix python-setuptools python-pip" -PIP_PKG="mock pip pytest pytest-mock pytest-sugar requests-mock tox" \ No newline at end of file diff --git a/rebuild_all.sh b/rebuild_all.sh index 2717101..377ef28 100755 --- a/rebuild_all.sh +++ b/rebuild_all.sh @@ -15,26 +15,29 @@ do for ynh_version in "testing" "unstable" do - lxc launch "yunohost-$debian_version-stable" "yunohost-$debian_version-$ynh_version-tmp" + for snapshot in "before-install" "after-install" + do + lxc launch "yunohost-$debian_version-stable-$snapshot" "yunohost-$debian_version-$ynh_version-$snapshot-tmp" - if [[ "$ynh_version" == "testing" ]] - then - repo_version="testing" - elif [[ "$DISTRIB" == "unstable" ]] - then - repo_version="testing unstable" - fi + 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 - sed -i 's@^deb http://forge.yunohost.org.*@& $repo_version@' \$FILE - done" + lxc exec "yunohost-$debian_version-$ynh_version-$snapshot-tmp" -- /bin/bash -c "for FILE in \`ls /etc/apt/sources.list /etc/apt/sources.list.d/*\`; + do + 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" + rotate_image "yunohost-$debian_version-$ynh_version-$snapshot-tmp" "yunohost-$debian_version-$ynh_version-$snapshot" - lxc delete -f "yunohost-$debian_version-$ynh_version-tmp" + lxc delete -f "yunohost-$debian_version-$ynh_version-$snapshot-tmp" - update_image "yunohost-$debian_version-$ynh_version" + update_image "yunohost-$debian_version-$ynh_version-$snapshot" + done done fi done \ No newline at end of file diff --git a/utils.sh b/utils.sh index a3d13c1..25cb0b0 100755 --- a/utils.sh +++ b/utils.sh @@ -160,6 +160,17 @@ rebuild_base_containers() # Run the YunoHost install script patched lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "cat install.sh | bash -s -- -a -d $ynh_version" + + if [[ "$debian_version" == "buster" ]] + then + YNH_DEPENDENCIES="apt apt-transport-https apt-utils avahi-daemon bind9utils ca-certificates cron curl debhelper dnsmasq dnsutils dovecot-antispam dovecot-core dovecot-ldap dovecot-lmtpd dovecot-managesieved equivs fail2ban fake-hwclock git haveged inetutils-ping iproute2 iptables jq ldap-utils libconvert-asn1-perl libdbd-ldap-perl libestr0 libfastjson4 libgssapi-perl libjq1 liblognorm5 libmcrypt4 libnet-ldap-perl libnss-ldapd libnss-mdns libnss-myhostname libopts25 libpam-ldapd libyaml-0-2 logrotate lsb-release lsof lua5.1 lua-bitop lua-event lua-expat lua-filesystem lua-json lua-ldap lua-lpeg lua-rex-pcre lua-sec lua-socket lua-zlib mailutils mariadb-server netcat-openbsd nginx nginx-extras ntp opendkim-tools openssh-server openssl php-curl php-gd php-mbstring php-xml php-curl php-fpm php-gd php-gettext php-intl php-ldap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pear php-php-gettext php-xml postfix postfix-ldap postfix-pcre postfix-policyd-spf-perl postsrsd procmail python-argcomplete python-bottle python-dbus python-dnspython python-gevent python-gevent-websocket python-greenlet python-jinja2 python-ldap python-miniupnpc python-openssl python-packaging python-psutil python-publicsuffix python-requests python-toml python-tz python-yaml redis-server resolvconf rspamd rsyslog slapd sudo-ldap unattended-upgrades unscd unzip wget whois" + else + YNH_DEPENDENCIES="apt apt-transport-https apt-utils avahi-daemon bind9utils ca-certificates cron curl debhelper dnsmasq dnsutils dovecot-antispam dovecot-core dovecot-ldap dovecot-lmtpd dovecot-managesieved equivs fail2ban fake-hwclock git haveged inetutils-ping iproute2 iptables jq ldap-utils libconvert-asn1-perl libdbd-ldap-perl libestr0 libfastjson4 libgssapi-perl libjq1 liblogging-stdlog0 liblognorm5 libmcrypt4 libnet-ldap-perl libnss-ldapd libnss-mdns libnss-myhostname libonig4 libopts25 libpam-ldapd libyaml-0-2 logrotate lsb-release lsof lua5.1 lua-bitop lua-event lua-expat lua-filesystem lua-json lua-ldap lua-lpeg lua-rex-pcre lua-sec lua-socket lua-zlib mailutils mariadb-server netcat-openbsd nginx nginx-extras ntp opendkim-tools openssh-server openssl php-curl php-gd php-mbstring php-mcrypt php-xml php-curl php-fpm php-gd php-gettext php-intl php-ldap php-mbstring php-mcrypt php-mysql php-mysqlnd php-pear php-php-gettext php-xml postfix postfix-ldap postfix-pcre postfix-policyd-spf-perl postsrsd procmail python-argcomplete python-bottle python-dbus python-dnspython python-gevent python-gevent-websocket python-greenlet python-jinja2 python-ldap python-miniupnpc python-openssl python-packaging python-psutil python-publicsuffix python-requests python-toml python-tz python-yaml redis-server resolvconf rspamd rsyslog slapd sudo-ldap unattended-upgrades unscd unzip wget whois" + fi + + BUILD_DEPENDENCIES="git-buildpackage postfix python-setuptools python-pip" + PIP_PKG="mock pip pytest pytest-mock pytest-sugar requests-mock tox" + # Pre install dependencies lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt-get --assume-yes -o Dpkg::Options::=\"--force-confold\" install --assume-yes $YNH_DEPENDENCIES $BUILD_DEPENDENCIES" lxc exec "$base_image_to_rebuild-tmp" -- /bin/bash -c "pip install -U $PIP_PKG"