.travis.docker 717 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash -ex
  2. case "$1" in
  3. before_install)
  4. if [ "$TRAVIS_OS_NAME" == "linux" ]; then
  5. docker create \
  6. --name=$TRAVIS_COMMIT -t \
  7. -v `pwd`:/tmp/build \
  8. -w /tmp/build \
  9. $DISTRO /bin/cat
  10. docker start $TRAVIS_COMMIT
  11. fi
  12. ;;
  13. after_script)
  14. if [ "$TRAVIS_OS_NAME" == "linux" ]; then
  15. docker kill $TRAVIS_COMMIT
  16. docker rm $TRAVIS_COMMIT
  17. fi
  18. ;;
  19. *)
  20. if [ -x ./.travis.$1 ]; then
  21. if [ "$TRAVIS_OS_NAME" == "linux" ]; then
  22. docker exec \
  23. `bash <(curl -s https://codecov.io/env)` \
  24. -e CC -e DISTRO \
  25. $TRAVIS_COMMIT ./.travis.$1
  26. else
  27. ./.travis.$1
  28. fi
  29. fi
  30. ;;
  31. esac