2015-02-25 14:52:55 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# This should be run inside a container built from the Dockerfile
|
|
|
|
# at the root of the repo - script/test will do it automatically.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
>&2 echo "Running lint checks"
|
2015-08-25 16:57:21 +02:00
|
|
|
docker run --rm \
|
|
|
|
${GIT_VOLUME} \
|
|
|
|
--entrypoint="tox" \
|
|
|
|
"$TAG" -e pre-commit
|
2015-02-25 14:52:55 +01:00
|
|
|
|
2015-08-31 23:29:25 +02:00
|
|
|
ALL_DOCKER_VERSIONS="1.7.1 1.8.2"
|
|
|
|
DEFAULT_DOCKER_VERSION="1.8.2"
|
|
|
|
|
2015-02-25 14:52:55 +01:00
|
|
|
if [ "$DOCKER_VERSIONS" == "" ]; then
|
2015-07-29 17:16:42 +02:00
|
|
|
DOCKER_VERSIONS="$DEFAULT_DOCKER_VERSION"
|
2015-02-25 14:52:55 +01:00
|
|
|
elif [ "$DOCKER_VERSIONS" == "all" ]; then
|
|
|
|
DOCKER_VERSIONS="$ALL_DOCKER_VERSIONS"
|
|
|
|
fi
|
|
|
|
|
2015-08-31 23:29:25 +02:00
|
|
|
|
|
|
|
BUILD_NUMBER=${BUILD_NUMBER-$USER}
|
|
|
|
|
2015-02-25 14:52:55 +01:00
|
|
|
for version in $DOCKER_VERSIONS; do
|
|
|
|
>&2 echo "Running tests against Docker $version"
|
2015-07-29 17:16:42 +02:00
|
|
|
|
2015-08-31 23:29:25 +02:00
|
|
|
daemon_container="compose-dind-$version-$BUILD_NUMBER"
|
|
|
|
trap "docker rm -vf $daemon_container" EXIT
|
|
|
|
|
|
|
|
# TODO: remove when we stop testing against 1.7.x
|
|
|
|
daemon=$([[ "$version" == "1.7"* ]] && echo "-d" || echo "daemon")
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
-d \
|
|
|
|
--name "$daemon_container" \
|
|
|
|
--privileged \
|
|
|
|
--volume="/var/lib/docker" \
|
|
|
|
dockerswarm/dind:$version \
|
|
|
|
docker $daemon -H tcp://0.0.0.0:2375 $DOCKER_DAEMON_ARGS \
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--link="$daemon_container:docker" \
|
|
|
|
--env="DOCKER_HOST=tcp://docker:2375" \
|
|
|
|
--entrypoint="tox" \
|
|
|
|
"$TAG" \
|
|
|
|
-e py27,py34 -- "$@"
|
|
|
|
|
2015-02-25 14:52:55 +01:00
|
|
|
done
|