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.

71 lines
1.3 KiB

8 years ago
  1. #!/bin/bash -x
  2. # Inspired by https://github.com/google/fruit
  3. : ${N_JOBS:=2}
  4. : ${TIMEOUT_MAC:=1800}
  5. : ${TIMEOUT_LINUX:=2300}
  6. if [ "$STL" != "" ]
  7. then
  8. STLARG="-stdlib=$STL"
  9. fi
  10. EXITCODE=42
  11. # Skip this run?
  12. if [ -f build/skip.txt ]
  13. then
  14. # Remove flag s.t. tests will be executed
  15. if [[ "$2" == "Build4" ]]
  16. then
  17. rm build/skip.txt
  18. fi
  19. exit 0
  20. fi
  21. case $OS in
  22. linux)
  23. # Execute docker image on Linux
  24. # Stop previous session
  25. docker rm -f storm &>/dev/null
  26. # Run container
  27. set -e
  28. docker run -d -it --name storm --privileged mvolk/storm-basesystem:$LINUX
  29. # Copy local content into container
  30. docker exec storm mkdir storm
  31. docker cp . storm:/storm
  32. set +e
  33. # Execute main process
  34. timeout $TIMEOUT_LINUX docker exec storm bash -c "
  35. export COMPILER=$COMPILER;
  36. export N_JOBS=$N_JOBS;
  37. export STLARG=$STLARG;
  38. export OS=$OS;
  39. cd storm;
  40. travis/build-helper.sh $1 $2"
  41. EXITCODE=$?
  42. ;;
  43. osx)
  44. # Mac OSX
  45. export COMPILER
  46. export N_JOBS
  47. export STLARG
  48. export OS
  49. gtimeout $TIMEOUT_MAC travis/build-helper.sh "$1" "$2"
  50. EXITCODE=$?
  51. ;;
  52. *)
  53. # Unknown OS
  54. echo "Unsupported OS: $OS"
  55. exit 1
  56. esac
  57. if [[ $EXITCODE == 124 ]] && [[ "$2" == Build* ]] && [[ "$2" != "Build4" ]]
  58. then
  59. exit 0
  60. else
  61. exit $EXITCODE
  62. fi