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.

73 lines
1.4 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. OS=$TRAVIS_OS_NAME
  7. EXITCODE=42
  8. # Skip this run?
  9. if [ -f build/skip.txt ]
  10. then
  11. # Remove flag s.t. tests will be executed
  12. if [[ "$1" == "Build4" ]]
  13. then
  14. rm build/skip.txt
  15. fi
  16. exit 0
  17. fi
  18. case $OS in
  19. linux)
  20. # Execute docker image on Linux
  21. # Stop previous session
  22. docker rm -f storm &>/dev/null
  23. # Run container
  24. set -e
  25. docker run -d -it --name storm --privileged mvolk/storm-basesystem:$LINUX
  26. # Install dependencies
  27. docker exec storm apt-get install -qq -y libeigen3-dev
  28. # Copy local content into container
  29. docker exec storm mkdir storm
  30. docker cp . storm:/storm
  31. set +e
  32. # Execute main process
  33. timeout $TIMEOUT_LINUX docker exec storm bash -c "
  34. export CONFIG=$CONFIG;
  35. export COMPILER=$COMPILER;
  36. export N_JOBS=$N_JOBS;
  37. export STLARG=;
  38. export OS=$OS;
  39. cd storm;
  40. travis/build-helper.sh $1"
  41. EXITCODE=$?
  42. ;;
  43. osx)
  44. # Mac OSX
  45. STLARG="-stdlib=libc++"
  46. export CONFIG=$CONFIG
  47. export COMPILER
  48. export N_JOBS
  49. export STLARG
  50. export OS
  51. gtimeout $TIMEOUT_MAC travis/build-helper.sh "$1"
  52. EXITCODE=$?
  53. ;;
  54. *)
  55. # Unknown OS
  56. echo "Unsupported OS: $OS"
  57. exit 1
  58. esac
  59. if [[ $EXITCODE == 124 ]] && [[ "$1" == Build* ]] && [[ "$1" != "Build4" ]]
  60. then
  61. exit 0
  62. else
  63. exit $EXITCODE
  64. fi