Fail on errors

This commit is contained in:
Jonatan Castro 2020-11-26 17:48:33 +11:00
parent 9882f230b4
commit cbd0e81210

View File

@ -9,14 +9,14 @@ jobs:
- run: - run:
name: Check SSL Certificates name: Check SSL Certificates
command: | command: |
DATE=`date "+%Y%m%d-%H%M"` set -e
sudo pip install -r requirements.txt sudo pip install -r requirements.txt
OUTPUT=$(./ssl_checker.py -f ./hosts_to_check) OUTPUT=$(./ssl_checker.py -f ./hosts_to_check)
echo "$OUTPUT" echo "$OUTPUT"
if ! [[echo "$OUTPUT" | grep "Warning: 0"]]; then if ! [[ echo "$OUTPUT" | grep "Warning: 0" ]]; then
.circleci/slack-message.sh "*Checked SSL Certificates*: Warnings :warning:" "MASTER" $DATE "#FFFF00" .circleci/slack-message.sh "*Checked SSL Certificates*: Warnings :warning:" "MASTER" $DATE "#FFFF00"
fi fi
if ! [[echo "$OUTPUT" | grep "Expired: 0"]]; then if ! [[ echo "$OUTPUT" | grep "Expired: 0" ]]; then
.circleci/slack-message.sh "*Checked SSL Certificates*: Expired :x:" "MASTER" $DATE "#FF0000" .circleci/slack-message.sh "*Checked SSL Certificates*: Expired :x:" "MASTER" $DATE "#FF0000"
fi fi
.circleci/slack-message.sh "*Checked SSL Certificates*: Success :key:" "MASTER" $DATE "#008000" .circleci/slack-message.sh "*Checked SSL Certificates*: Success :key:" "MASTER" $DATE "#008000"