Merge pull request #14547 from nextcloud/backport/14373/stable14

[stable14] Add test for updated CA bundle
This commit is contained in:
Roeland Jago Douma 2019-03-05 19:52:48 +01:00 committed by GitHub
commit 8ca4bc7a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -10,6 +10,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

22
build/ca-bundle-checker.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
echo
if [[ -n ${DRONE_COMMIT_REFSPEC} && ! ${DRONE_COMMIT_REFSPEC} =~ 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