.travis.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. language: go
  2. sudo: false
  3. install:
  4. - mkdir -p "${GOPATH%%:*}/src/github.com/shurcooL/markdownfmt"
  5. - git clone https://github.com/tianon/markdownfmt.git "${GOPATH%%:*}/src/github.com/shurcooL/markdownfmt"
  6. - go get -v github.com/shurcooL/markdownfmt
  7. script:
  8. - files="$(find -name '*.md' -print0 | xargs -0 markdownfmt -l)";
  9. if [ "$files" ]; then
  10. echo >&2 'Need markdownfmt:';
  11. echo >&2 "$files";
  12. echo >&2;
  13. echo "$files" | xargs markdownfmt -d >&2;
  14. exit 1;
  15. fi
  16. - failed='';
  17. for short in */README-short.txt; do
  18. chars="$(echo -n "$(cat "$short")" | wc -m)";
  19. lines="$(cat "$short" | wc -l)";
  20. if [ "$chars" -gt 100 -o "$lines" -gt 1 ]; then
  21. failed+=" $short";
  22. fi
  23. done;
  24. if [ "$failed" ]; then
  25. echo >&2 "Too long (or too many lines):$failed";
  26. exit 1;
  27. fi
  28. - if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
  29. if [ "$(git diff --numstat "$TRAVIS_COMMIT_RANGE" -- '*/README.md')" ]; then
  30. echo >&2 'Error:'' at least one repo README.md has changed';
  31. echo >&2 'These files are autogenerated, so it is unnecessary to modify them';
  32. echo >&2 'Please update content.md and docker-library-bot will take care of README.md';
  33. echo >&2 'See:'' https://github.com/docker-library/docs/#image-namereadmemd';
  34. echo >&2;
  35. exit 1;
  36. fi
  37. fi