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:
4
tests/vagrant/Vagrantfile
vendored
4
tests/vagrant/Vagrantfile
vendored
@@ -3,7 +3,7 @@ load './funcs.rb'
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.synced_folder "../..", "/mailinabox", id: "mailinabox", automount: false
|
||||
use_preloaded_box config, "ubuntu/bionic64"
|
||||
use_preloaded_box config, "ubuntu/jammy64"
|
||||
|
||||
# fresh install with encryption-at-rest
|
||||
|
||||
@@ -43,7 +43,7 @@ SH
|
||||
cd /mailinabox
|
||||
source tests/vagrant/globals.sh || exit 1
|
||||
export PRIMARY_HOSTNAME=qa3.abc.com
|
||||
export UPSTREAM_TAG=main
|
||||
export UPSTREAM_TAG=jammyjellyfish2204
|
||||
tests/system-setup/upgrade-from-upstream.sh basic totpuser || exit 1
|
||||
tests/runner.sh upgrade-basic upgrade-totpuser default || exit 2
|
||||
SH
|
||||
|
||||
1
tests/vagrant/preloaded/.gitignore
vendored
1
tests/vagrant/preloaded/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
*.box
|
||||
src/
|
||||
|
||||
30
tests/vagrant/preloaded/Vagrantfile
vendored
30
tests/vagrant/preloaded/Vagrantfile
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
2
tests/vagrant/vanilla/Vagrantfile
vendored
2
tests/vagrant/vanilla/Vagrantfile
vendored
@@ -4,7 +4,7 @@ Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
|
||||
config.vm.network "public_network", bridge: "#$default_network_interface"
|
||||
use_preloaded_box config, "ubuntu/bionic64", ".."
|
||||
use_preloaded_box config, "ubuntu/jammy64", ".."
|
||||
|
||||
# vanilla install
|
||||
|
||||
|
||||
Reference in New Issue
Block a user