Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2017 17:39
Show Gist options
  • Save anonymous/8462638d2ea2d16f850cfcc1ce53beef to your computer and use it in GitHub Desktop.
Save anonymous/8462638d2ea2d16f850cfcc1ce53beef to your computer and use it in GitHub Desktop.
Libreant installation test script based on docker containers
#! /bin/bash
DIR=$(dirname "$(readlink -f "$0")")
LIBREANT_SRC=$(readlink -f ${DIR}/..)
DEBIAN="debian-stable"
UBUNTU="ubuntu-lts"
ARCH="arch"
OSES=( ${DEBIAN} ${UBUNTU} ${ARCH} )
PREFIX="libreant-inst-test__"
function cleanup {
for os in ${OSES[@]}; do
docker kill ${OSES[@]/#/"$PREFIX"} > /dev/null 2>&1
done
}
#trap cleanup EXIT
set -e
for os in ${OSES[@]} ; do
printf "Testing libreant installation on ${os}\n"
docker build --file="${LIBREANT_SRC}/.docker/dockerfile-${os}" --tag="${PREFIX}${os}" "${LIBREANT_SRC}"
docker run --rm -p 5000:5000 -d --name ${PREFIX}${os} ${PREFIX}${os}
curl --fail -vsS "localhost:5000/search?q=*:*" > /dev/null
docker kill ${PREFIX}${os}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment