sagacheck.sh 689 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. if [ ! -d "${CI_PROJECT_DIR}/../src" ];then
  3. mkdir ${CI_PROJECT_DIR}/../src
  4. fi
  5. ln -fs ${CI_PROJECT_DIR} ${CI_PROJECT_DIR}/../src
  6. export GOPATH=${CI_PROJECT_DIR}/..
  7. exitCode=0
  8. # CHANGELOG check
  9. echo "====CHANGELOG check:===="
  10. files=`.rider/changefiles.sh "CHANGELOG.md"`
  11. if [[ "${files}" = "" ]]; then
  12. echo "未发现CHANGELOG.md文件变更,请'添加'或'修改'CHANGELOG.md"
  13. exit 1
  14. else
  15. echo -e "变更如下:\n${files}"
  16. fi
  17. # BGR rule
  18. echo -e "\n====Bili golang rule check:===="
  19. diffFiles=`.rider/changefiles.sh`
  20. cd $GOPATH/src/go-common
  21. go build ./app/tool/bgr
  22. ./bgr -script=./app/tool/bgr -hit=main -type=file ${diffFiles}
  23. exitCode=$?
  24. exit ${exitCode}