Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable15] Add test for updated CA bundle #14546

Merged
merged 2 commits into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions autotest-checkers.sh
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions build/ca-bundle-checker.sh
@@ -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