test-travis.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # Stop on error
  3. set -e
  4. # Install dependencies
  5. echo travis_fold:start:Dependencies
  6. wget http://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
  7. tar xf ffmpeg-git-64bit-static.tar.xz
  8. mkdir -p $HOME/bin
  9. cp ffmpeg-git-*-static/{ffmpeg,ffprobe,ffserver} $HOME/bin
  10. cp ffmpeg-git-*-static/{ffmpeg,ffprobe} $(pwd)
  11. export PATH=$(pwd)/bin:$PATH
  12. export ALT_FFMPEG_PATH=$(pwd)/ffmpeg
  13. export ALT_FFPROBE_PATH=$(pwd)/ffprobe
  14. if [ -z "$(which flvtool2)" ]; then
  15. export FLVTOOL2_PRESENT=no
  16. else
  17. export FLVTOOL2_PRESENT=yes
  18. fi
  19. echo travis_fold:end:Dependencies
  20. # Install nvm if needed
  21. echo travis_fold:start:nvm
  22. if [ ! -d ~/.nvm ]; then
  23. wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.6.1/install.sh | sh
  24. fi
  25. source ~/.nvm/nvm.sh
  26. nvm install $NODE_VERSION
  27. echo travis_fold:end:nvm
  28. # Print versions
  29. echo travis_fold:start:Versions
  30. echo "node version: $(node --version)"
  31. echo "npm version: $(npm --version)"
  32. echo "ffmpeg version: $(ffmpeg -version)"
  33. echo travis_fold:end:Versions
  34. # Install dependencies
  35. echo travis_fold:start:npm-install
  36. npm install
  37. echo travis_fold:end:npm-install
  38. # Run tests
  39. make test