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.

80 lines
1.6 KiB

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