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.

87 lines
1.7 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. # Install doxygen if necessary
  36. if [[ "$TASK" == *Doxygen* ]]
  37. then
  38. docker exec storm apt-get install -qq -y doxygen dot
  39. fi
  40. # Copy local content into container
  41. docker exec storm mkdir /opt/storm
  42. docker cp . storm:/opt/storm
  43. set +e
  44. # Execute main process
  45. docker exec storm bash -c "
  46. export CONFIG=$CONFIG;
  47. export TASK=$TASK;
  48. export COMPILER=$COMPILER;
  49. export N_JOBS=$N_JOBS;
  50. export STLARG=;
  51. export OS=$OS;
  52. cd /opt/storm;
  53. timeout $TIMEOUT_LINUX ./travis/build_helper.sh $1"
  54. EXITCODE=$?
  55. ;;
  56. osx)
  57. # Mac OSX
  58. STLARG="-stdlib=libc++"
  59. export CONFIG
  60. export TASK
  61. export COMPILER
  62. export N_JOBS
  63. export STLARG
  64. export OS
  65. gtimeout $TIMEOUT_MAC travis/build_helper.sh "$1"
  66. EXITCODE=$?
  67. ;;
  68. *)
  69. # Unknown OS
  70. echo "Unsupported OS: $OS"
  71. exit 1
  72. esac
  73. if [[ $EXITCODE == 124 ]] && [[ "$1" == Build* ]] && [[ "$1" != "BuildLast" ]]
  74. then
  75. exit 0
  76. else
  77. exit $EXITCODE
  78. fi