Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "checking if /json was changed..."
  20. egrep "\+{3}\s.\/json\/" 527.diff > json.txt
  21. if [[$? == 0]]; then
  22. echo "JSON files are auto-generated! Please do not update these files:"
  23. cat json.txt
  24. exit 1
  25. else
  26. echo "/json check passed!"
  27. rm json.txt
  28. fi
  29. echo "running format validation..."
  30. ./validate_format.rb $FORMAT_FILE
  31. if [[ $? != 0 ]]; then
  32. echo "format validation failed!"
  33. exit 1
  34. else
  35. echo "format validation passed!"
  36. ./build.sh && ./deploy.sh
  37. if [[ $? != 0 ]]; then
  38. echo "JSON build and deploy failed!"
  39. else
  40. echo "JSON build and deploy success!"
  41. fi
  42. fi
  43. echo "running link validation..."
  44. ./validate_links.rb $LINK_FILE
  45. if [[ $? != 0 ]]; then
  46. echo "link validation failed!"
  47. exit 1
  48. else
  49. echo "link validation passed!"
  50. fi