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.

62 lines
1.2 KiB

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