Created
December 14, 2017 17:39
-
-
Save anonymous/8462638d2ea2d16f850cfcc1ce53beef to your computer and use it in GitHub Desktop.
Libreant installation test script based on docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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