2015-07-28 03:08:04 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Run the integration tests with multiple versions of the Docker engine
|
|
|
|
|
|
|
|
set -e
|
2015-07-31 00:38:33 +02:00
|
|
|
set -x
|
2015-07-28 03:08:04 +02:00
|
|
|
|
2016-03-30 22:55:24 +02:00
|
|
|
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2015-07-28 03:08:04 +02:00
|
|
|
|
2016-03-31 01:07:22 +02:00
|
|
|
|
|
|
|
if [ "$TMPDIR" != "" ] && [ ! -d "$TMPDIR" ]; then
|
|
|
|
mkdir -p $TMPDIR
|
|
|
|
fi
|
|
|
|
|
|
|
|
cachedir=`mktemp -t -d golem-cache.XXXXXX`
|
|
|
|
trap "rm -rf $cachedir" EXIT
|
|
|
|
|
2015-08-04 20:49:55 +02:00
|
|
|
if [ "$1" == "-d" ]; then
|
2016-03-30 22:55:24 +02:00
|
|
|
# Drivers to use for Docker engines the tests are going to create.
|
|
|
|
STORAGE_DRIVER=${STORAGE_DRIVER:-overlay}
|
|
|
|
|
|
|
|
docker daemon --log-level=panic --storage-driver="$STORAGE_DRIVER" &
|
|
|
|
DOCKER_PID=$!
|
|
|
|
|
|
|
|
# Wait for it to become reachable.
|
|
|
|
tries=10
|
|
|
|
until docker version &> /dev/null; do
|
|
|
|
(( tries-- ))
|
|
|
|
if [ $tries -le 0 ]; then
|
|
|
|
echo >&2 "error: daemon failed to start"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
trap "kill $DOCKER_PID" EXIT
|
2015-07-28 03:08:04 +02:00
|
|
|
fi
|
|
|
|
|
2016-03-30 22:55:24 +02:00
|
|
|
distimage=$(docker build -q $DIR/../..)
|
|
|
|
fullversion=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
|
|
|
|
distversion=${fullversion:1}
|
2015-07-31 00:38:33 +02:00
|
|
|
|
2016-03-30 22:55:24 +02:00
|
|
|
echo "Testing image $distimage with distribution version $distversion"
|
2015-07-28 03:08:04 +02:00
|
|
|
|
2016-03-30 22:55:24 +02:00
|
|
|
# Pull needed images before invoking golem to get pull time
|
|
|
|
# These images are defined in golem.conf
|
|
|
|
time docker pull nginx:1.9
|
|
|
|
time docker pull golang:1.6
|
|
|
|
time docker pull dmcgowan/token-server:simple
|
|
|
|
time docker pull dmcgowan/token-server:oauth
|
|
|
|
time docker pull distribution/golem-runner:0.1-bats
|
2015-07-28 03:08:04 +02:00
|
|
|
|
2016-03-30 22:55:24 +02:00
|
|
|
time docker pull docker:1.9.1-dind
|
|
|
|
time docker pull docker:1.10.3-dind
|
2016-04-28 23:51:13 +02:00
|
|
|
time docker pull docker:1.11.1-dind
|
2016-11-21 19:53:46 +01:00
|
|
|
time docker pull docker:1.12.3-dind
|
2015-07-31 00:38:33 +02:00
|
|
|
|
2016-03-31 01:07:22 +02:00
|
|
|
golem -cache $cachedir \
|
2016-03-30 22:55:24 +02:00
|
|
|
-i "golem-distribution:latest,$distimage,$distversion" \
|
|
|
|
-i "golem-dind:latest,docker:1.9.1-dind,1.9.1" \
|
|
|
|
-i "golem-dind:latest,docker:1.10.3-dind,1.10.3" \
|
2016-04-28 23:51:13 +02:00
|
|
|
-i "golem-dind:latest,docker:1.11.1-dind,1.11.1" \
|
2016-11-21 19:53:46 +01:00
|
|
|
-i "golem-dind:latest,docker:1.12.3-dind,1.12.0" \
|
2016-03-30 22:55:24 +02:00
|
|
|
$DIR
|
2015-07-31 00:38:33 +02:00
|
|
|
|