1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

Merge branch 'jammyjellyfish2204' of https://github.com/mail-in-a-box/mailinabox into jammyjellyfish2204

# Conflicts:
#	README.md
#	setup/mail-dovecot.sh
#	setup/system.sh
#	setup/webmail.sh
#	setup/zpush.sh
#	tests/test_mail.py
This commit is contained in:
downtownallday
2022-01-11 16:39:39 -05:00
31 changed files with 259 additions and 194 deletions

View File

@@ -1 +1,2 @@
*.box
src/

View File

@@ -1,19 +1,43 @@
def checkout_tag_and_mount(obj, tag)
if "#{tag}" == ""
obj.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
else
_srcdir="src/maibldap-#{tag}"
if not Dir.exist?(_srcdir)
puts "Cloning tag #{tag} to #{_srcdir}"
system("git clone -b #{tag} --depth 1 #{ENV['MIABLDAP_GIT']} #{_srcdir}")
end
obj.vm.synced_folder _srcdir, "/mailinabox", id: "mailinabox", automount: false
end
end
Vagrant.configure("2") do |config|
config.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
checkout_tag_and_mount config, ENV['RELEASE_TAG']
config.vm.define "preloaded-ubuntu-bionic64" do |m1|
m1.vm.box = "ubuntu/bionic64"
m1.vm.provision :shell, :inline => <<-SH
cd /mailinabox
tests/vagrant/preloaded/prepvm.sh --no-dry-run
rc=$?
echo "$rc" > "tests/vagrant/preloaded/prepcode.txt"
echo "$rc" > "/vagrant/prepcode.txt"
[ $rc -gt 0 ] && exit 1
exit 0
SH
end
config.vm.define "preloaded-ubuntu-jammy64" do |m1|
m1.vm.box = "ubuntu/jammy64"
m1.vm.provision :shell, :inline => <<-SH
cd /mailinabox
tests/vagrant/preloaded/prepvm.sh --no-dry-run
rc=$?
echo "$rc" > "/vagrant/prepcode.txt"
[ $rc -gt 0 ] && exit 1
exit 0
SH
end
end

View File

@@ -1,5 +1,13 @@
#!/bin/bash
# load defaults for MIABLDAP_RELEASE_TAG and MIABLDAP_GIT
pushd "../../.." >/dev/null
source tests/system-setup/setup-defaults.sh || exit 1
popd >/dev/null
# TODO: replace MIABLDAP_RELEASE_TAG with the actual tag for the last supported version of miabldap for bionic64
UBUNTU_BIONIC64_RELEASE_TAG=$MIABLDAP_RELEASE_TAG
vagrant destroy -f
rm -f prepcode.txt
@@ -12,10 +20,44 @@ done
vagrant box update
for box in "preloaded-ubuntu-bionic64"
boxes=(
"preloaded-ubuntu-bionic64"
"preloaded-ubuntu-jammy64"
)
# preload packages from source of the following git tags. empty string
# means use the current source tree
tags=(
"$UBUNTU_BIONIC64_RELEASE_TAG"
""
)
try_reboot=(
false
true
)
idx=0
for box in "${boxes[@]}"
do
if [ ! -z "$1" -a "$1" != "$box" ]; then
continue
fi
export RELEASE_TAG="${tags[$idx]}"
vagrant up $box
upcode=$?
if [ $upcode -ne 0 -a ! -e "./prepcode.txt" ] && ${try_reboot[$idx]}
then
# a reboot may be necessary if guest addtions was newly
# compiled by vagrant plugin "vagrant-vbguest"
echo ""
echo "VAGRANT UP RETURNED $upcode -- RETRYING AFTER REBOOT"
vagrant halt $box
vagrant up $box
upcode=$?
fi
let idx+=1
prepcode=$(cat "./prepcode.txt")
rm -f prepcode.txt
echo ""
@@ -49,5 +91,5 @@ do
vagrant box remove $cached_name
code=$?
fi
echo "Result: $code"
echo "Remove cache box result: $code - ignoring"
done

View File

@@ -66,6 +66,13 @@ install_packages() {
# don't install slapd - it requires user input
pkgs="$(sed 's/slapd//g' <<< "$pkgs")"
if [ $(. /etc/os-release; echo $VERSION_ID | awk -F. '{print $1}') -ge 22 ];
then
# don't install opendmarc on ubuntu 22 and higher - it requires
# interactive user input
pkgs="$(sed 's/opendmarc//g' <<< "$pkgs")"
fi
if [ ! -z "$pkgs" ]; then
echo "install: $pkgs"