test-versions 824 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # This should be run inside a container built from the Dockerfile
  3. # at the root of the repo - script/test will do it automatically.
  4. set -e
  5. >&2 echo "Running lint checks"
  6. docker run --rm \
  7. ${GIT_VOLUME} \
  8. --entrypoint="tox" \
  9. "$TAG" -e pre-commit
  10. if [ "$DOCKER_VERSIONS" == "" ]; then
  11. DOCKER_VERSIONS="default"
  12. elif [ "$DOCKER_VERSIONS" == "all" ]; then
  13. DOCKER_VERSIONS="$ALL_DOCKER_VERSIONS"
  14. fi
  15. for version in $DOCKER_VERSIONS; do
  16. >&2 echo "Running tests against Docker $version"
  17. docker run \
  18. --rm \
  19. --privileged \
  20. --volume="/var/lib/docker" \
  21. --volume="${COVERAGE_DIR:-$(pwd)/coverage-html}:/code/coverage-html" \
  22. -e "DOCKER_VERSION=$version" \
  23. -e "DOCKER_DAEMON_ARGS" \
  24. --entrypoint="script/dind" \
  25. "$TAG" \
  26. script/wrapdocker tox -e py27,py34 -- "$@"
  27. done