ca-bundle-checker.sh 604 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. echo
  3. if [[ -n ${DRONE_COMMIT_REFSPEC} && ! ${DRONE_COMMIT_REFSPEC} =~ version\/noid\/.+ ]]; then
  4. echo "Skip CA bundle check"
  5. exit 0
  6. fi
  7. echo "Fetching latest ca-bundle.crt ..."
  8. curl -o resources/config/ca-bundle.crt https://curl.haxx.se/ca/cacert.pem
  9. echo
  10. outdated=$(git diff --name-only | grep "resources/config/ca-bundle.crt")
  11. if [ "${outdated}" = "resources/config/ca-bundle.crt" ]; then
  12. echo "CA bundle is not up to date."
  13. echo "Please run: bash build/ca-bundle-checker.sh"
  14. echo "And commit the result"
  15. exit 1
  16. fi
  17. echo "CA bundle is up to date."
  18. exit 0