pytest.sh 1.3 KB

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. ###############################################################################
  3. # #
  4. # This script is meant to run the test suite from a Docker container. #
  5. # #
  6. # This is usefull when you want to run the test suite from Mac or #
  7. # Docker Toolbox. #
  8. # #
  9. ###############################################################################
  10. # Returns the absolute directory path to this script
  11. DIR=$(cd "${0%/*}" && pwd) || exit 1
  12. # check requirements
  13. echo "> Building nginx-proxy-tester image..."
  14. docker build -t nginx-proxy-tester \
  15. -f "${DIR}/requirements/Dockerfile-nginx-proxy-tester" \
  16. "${DIR}/requirements" \
  17. || exit 1
  18. # run the nginx-proxy-tester container setting the correct value for the working dir in order for
  19. # docker-compose to work properly when run from within that container.
  20. exec docker run --rm -it --name "nginx-proxy-pytest" \
  21. --volume "/var/run/docker.sock:/var/run/docker.sock" \
  22. --volume "${DIR}:${DIR}" \
  23. --workdir "${DIR}" \
  24. nginx-proxy-tester "$@"