You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
997 B

8 years ago
  1. #!/bin/bash -x
  2. # Inspired by https://github.com/google/fruit
  3. set -e
  4. : ${N_JOBS:=2}
  5. : ${TIMEOUT:=2200}
  6. if [ "$STL" != "" ]
  7. then
  8. STLARG="-stdlib=$STL"
  9. fi
  10. case $OS in
  11. linux)
  12. # Execute docker image on linux
  13. # Stop previous session
  14. docker rm -f storm &>/dev/null || true
  15. # Run container
  16. docker run -d -it --name storm --privileged mvolk/storm-basesystem:$LINUX
  17. # Copy local content into container
  18. docker exec storm mkdir storm
  19. docker cp . storm:/storm
  20. # Execute main process
  21. timeout $TIMEOUT docker exec storm bash -c "
  22. export COMPILER=$COMPILER;
  23. export N_JOBS=$N_JOBS;
  24. export STLARG=$STLARG;
  25. export OS=$OS;
  26. cd storm;
  27. travis/postsubmit-helper.sh $1 $2"
  28. exit $?
  29. ;;
  30. osx)
  31. # Mac OSX
  32. export COMPILER
  33. export N_JOBS
  34. export STLARG
  35. export OS
  36. gtimeout $TIMEOUT travis/postsubmit-helper.sh "$1" "$2"
  37. exit $?
  38. ;;
  39. *)
  40. # Other OS
  41. echo "Unsupported OS: $OS"
  42. exit 1
  43. esac