test-linux-x64.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # Verify docker is available
  3. if ! type docker >/dev/null; then
  4. echo "Please install docker"
  5. exit 1
  6. fi
  7. test="npm run clean; npm install --unsafe-perm; npm test"
  8. # Debian 7, 8
  9. # Ubuntu 14.04, 16.04
  10. for dist in debian:jessie debian:stretch ubuntu:trusty ubuntu:xenial; do
  11. echo "Testing $dist..."
  12. docker pull $dist
  13. if docker run -i -t --rm -v $PWD:/v $dist >packaging/$dist.log 2>&1 sh -c "cd /v; ./packaging/test/debian.sh; $test";
  14. then echo "$dist OK"
  15. else echo "$dist fail" && cat packaging/$dist.log
  16. fi
  17. done
  18. # Centos 7
  19. echo "Testing centos7..."
  20. docker pull centos:7
  21. if docker run -i -t --rm -v $PWD:/v centos:7 >packaging/centos7.log 2>&1 sh -c "cd /v; ./packaging/test/centos.sh; $test";
  22. then echo "centos7 OK"
  23. else echo "centos7 fail" && cat packaging/centos7.log
  24. fi
  25. # Archlinux latest
  26. echo "Testing archlinux..."
  27. docker pull pritunl/archlinux:latest
  28. if docker run -i -t --rm -v $PWD:/v pritunl/archlinux:latest >packaging/archlinux.log 2>&1 sh -c "cd /v; ./packaging/test/archlinux.sh; $test";
  29. then echo "archlinux OK"
  30. else echo "archlinux fail" && cat packaging/archlinux.log
  31. fi