diff options
-rwxr-xr-x | autotest-checkers.sh | 2 | ||||
-rwxr-xr-x | build/ca-bundle-checker.sh | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/autotest-checkers.sh b/autotest-checkers.sh index 0bdd69510c6..f1b231d6200 100755 --- a/autotest-checkers.sh +++ b/autotest-checkers.sh @@ -8,6 +8,8 @@ php ./build/translation-checker.php RESULT=$(($RESULT+$?)) php ./build/htaccess-checker.php RESULT=$(($RESULT+$?)) +bash ./build/ca-bundle-checker.sh +RESULT=$(($RESULT+$?)) for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do diff --git a/build/ca-bundle-checker.sh b/build/ca-bundle-checker.sh new file mode 100755 index 00000000000..a23d6257d58 --- /dev/null +++ b/build/ca-bundle-checker.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +echo +if [[ -n ${DRONE_BRANCH} && ! ${DRONE_BRANCH} =~ version\/noid\/.+ ]]; then + echo "Skip CA bundle check" + exit 0 +fi + +echo "Fetching latest ca-bundle.crt ..." +curl -o resources/config/ca-bundle.crt https://curl.haxx.se/ca/cacert.pem + +echo +outdated=$(git diff --name-only | grep "resources/config/ca-bundle.crt") +if [ "${outdated}" = "resources/config/ca-bundle.crt" ]; then + echo "CA bundle is not up to date." + echo "Please run: bash build/ca-bundle-checker.sh" + echo "And commit the result" + exit 1 +fi + +echo "CA bundle is up to date." +exit 0 |