2015-07-28 01:08:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Run the integration tests with multiple versions of the Docker engine
|
|
|
|
|
|
|
|
set -e
|
2015-07-30 22:38:33 +00:00
|
|
|
set -x
|
2015-07-28 01:08:04 +00:00
|
|
|
|
2016-03-30 20:55:24 +00:00
|
|
|
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2015-07-28 01:08:04 +00:00
|
|
|
|
2016-03-30 23:07:22 +00: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 18:49:55 +00:00
|
|
|
if [ "$1" == "-d" ]; then
|
2016-03-30 20:55:24 +00: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 01:08:04 +00:00
|
|
|
fi
|
|
|
|
|
2016-03-30 20:55:24 +00:00
|
|
|
distimage=$(docker build -q $DIR/../..)
|
|
|
|
fullversion=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
|
|
|
|
distversion=${fullversion:1}
|
2015-07-30 22:38:33 +00:00
|
|
|
|
2016-03-30 20:55:24 +00:00
|
|
|
echo "Testing image $distimage with distribution version $distversion"
|
2015-07-28 01:08:04 +00:00
|
|
|
|
2016-03-30 20:55:24 +00: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 01:08:04 +00:00
|
|
|
|
2016-03-30 20:55:24 +00:00
|
|
|
time docker pull docker:1.9.1-dind
|
|
|
|
time docker pull docker:1.10.3-dind
|
2016-04-28 21:51:13 +00:00
|
|
|
time docker pull docker:1.11.1-dind
|
2016-07-14 23:24:40 +00:00
|
|
|
time docker pull docker:1.12.0-rc3-dind
|
2015-07-30 22:38:33 +00:00
|
|
|
|
2016-03-30 23:07:22 +00:00
|
|
|
golem -cache $cachedir \
|
2016-03-30 20:55:24 +00: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 21:51:13 +00:00
|
|
|
-i "golem-dind:latest,docker:1.11.1-dind,1.11.1" \
|
2016-07-14 23:24:40 +00:00
|
|
|
-i "golem-dind:latest,docker:1.12.0-rc3-dind,1.12.0" \
|
2016-03-30 20:55:24 +00:00
|
|
|
$DIR
|
2015-07-30 22:38:33 +00:00
|
|
|
|