Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

7 anos atrás
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. FORMAT_FILE=../README.md
  3. if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  4. echo "running on $TRAVIS_BRANCH branch"
  5. LINK_FILE=../README.md
  6. else
  7. echo "running on Pull Request #$TRAVIS_PULL_REQUEST"
  8. DIFF_URL="https://patch-diff.githubusercontent.com/raw/toddmotto/public-apis/pull/$TRAVIS_PULL_REQUEST.diff"
  9. curl $DIFF_URL > diff.txt
  10. echo "------- BEGIN DIFF -------"
  11. cat diff.txt
  12. echo "-------- END DIFF --------"
  13. cat diff.txt | egrep "\+" > additions.txt
  14. echo "------ BEGIN ADDITIONS -----"
  15. cat additions.txt
  16. echo "------- END ADDITIONS ------"
  17. LINK_FILE=additions.txt
  18. fi
  19. echo "running format validation..."
  20. ./validate_format.rb $FORMAT_FILE
  21. if [[ $? != 0 ]]; then
  22. echo "format validation failed!"
  23. exit 1
  24. else
  25. echo "format validation passed!"
  26. ./build.sh && ./deploy.sh
  27. if [[ $? != 0 ]]; then
  28. echo "JSON build and deploy failed!"
  29. else
  30. echo "JSON build and deploy success!"
  31. fi
  32. fi
  33. echo "running link validation..."
  34. ./validate_links.rb $LINK_FILE
  35. if [[ $? != 0 ]]; then
  36. echo "link validation failed!"
  37. exit 1
  38. else
  39. echo "link validation passed!"
  40. fi