circle-test-frontend.sh 560 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. function exit_if_fail {
  3. command=$@
  4. echo "Executing '$command'"
  5. eval $command
  6. rc=$?
  7. if [ $rc -ne 0 ]; then
  8. echo "'$command' returned $rc."
  9. exit $rc
  10. fi
  11. }
  12. cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
  13. rm -rf node_modules
  14. npm install -g yarn --quiet
  15. yarn install --pure-lockfile --no-progress
  16. exit_if_fail npm run test:coverage
  17. exit_if_fail npm run build
  18. # publish code coverage
  19. echo "Publishing javascript code coverage"
  20. bash <(curl -s https://codecov.io/bash) -cF javascript
  21. rm -rf coverage