2
0

pytest.sh 1.3 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. ###############################################################################
  3. # #
  4. # This script is meant to run the test suite from a Docker container. #
  5. # #
  6. # This is useful 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. TESTDIR=$(cd "${0%/*}" && pwd) || exit 1
  12. DIR=$(cd "${TESTDIR}/.." && pwd) || exit 1
  13. # check requirements
  14. echo "> Building nginx-proxy-tester image..."
  15. docker build --pull -t nginx-proxy-tester \
  16. -f "${TESTDIR}/requirements/Dockerfile-nginx-proxy-tester" \
  17. "${TESTDIR}/requirements" \
  18. || exit 1
  19. # run the nginx-proxy-tester container setting the correct value for the working dir
  20. # in order for docker compose to work properly when run from within that container.
  21. exec docker run --rm -it --name "nginx-proxy-pytest" \
  22. --volume "/var/run/docker.sock:/var/run/docker.sock" \
  23. --volume "${DIR}:${DIR}" \
  24. --workdir "${TESTDIR}" \
  25. nginx-proxy-tester "$@"