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=1600
  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. # Copy local content into container
  27. docker exec storm mkdir storm
  28. docker cp . storm:/storm
  29. set +e
  30. # Execute main process
  31. timeout $TIMEOUT_LINUX docker exec storm bash -c "
  32. export CONFIG=$CONFIG;
  33. export COMPILER=$COMPILER;
  34. export N_JOBS=$N_JOBS;
  35. export STLARG=;
  36. export OS=$OS;
  37. cd storm;
  38. travis/build-helper.sh $1"
  39. EXITCODE=$?
  40. ;;
  41. osx)
  42. # Mac OSX
  43. STLARG="-stdlib=libc++"
  44. export CONFIG=$CONFIG
  45. export COMPILER
  46. export N_JOBS
  47. export STLARG
  48. export OS
  49. gtimeout $TIMEOUT_MAC travis/build-helper.sh "$1"
  50. EXITCODE=$?
  51. ;;
  52. *)
  53. # Unknown OS
  54. echo "Unsupported OS: $OS"
  55. exit 1
  56. esac
  57. if [[ $EXITCODE == 124 ]] && [[ "$1" == Build* ]] && [[ "$1" != "Build4" ]]
  58. then
  59. exit 0
  60. else
  61. exit $EXITCODE
  62. fi