Refactor docker testing script

This commit is contained in:
2021-02-09 20:46:14 +01:00
parent 6232638023
commit b592d4516e

View File

@@ -4,7 +4,6 @@ set -o nounset
set -o errexit set -o errexit
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
tmpdir=/tmp/dotfiles
git archive --format tar --output "${tmpdir}/dotfiles.tar" HEAD git archive --format tar --output "${tmpdir}/dotfiles.tar" HEAD
@@ -17,24 +16,29 @@ git submodule foreach 'bash -x -c "
gzip -k -f -v "${tmpdir}/dotfiles.tar" gzip -k -f -v "${tmpdir}/dotfiles.tar"
exit 1 test_ares() {
docker pull docker.io/library/archlinux:base
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname ares docker.io/library/archlinux:base sh -c '
set -o errexit
docker pull docker.io/library/archlinux:base pacman -Syu --noconfirm python3
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname ares docker.io/library/archlinux:base sh -c '" cd $(mktemp -d)
set -o errexit tar xf /tmp/dotfiles.tar.gz -C .
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
read -p "Done, [return] to continue "
'
}
pacman -Syu --noconfirm python3 test_tb_hak() {
cd $(mktemp -d) docker pull docker.io/library/ubuntu:18.04
tar xf /tmp/dotfiles.tar.gz -C . docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname tb-hak docker.io/library/ubuntu:18.04 sh -c '
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh set -o errexit
read -p "Done, [return] to continue "
'
docker pull docker.io/library/ubuntu:18.04 cd $(mktemp -d)
docker run -ti --rm -v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro --hostname tb-hak docker.io/library/ubuntu:18.04 sh -c ' tar xf /tmp/dotfiles.tar.gz -C .
set -o errexit ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
'
}
cd $(mktemp -d) test_ares
tar xf /tmp/dotfiles.tar.gz -C . test_tb_hak
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
'