ssl-checker/.circleci/config.yml
2020-11-26 18:20:43 +11:00

46 lines
1.2 KiB
YAML

version: 2
jobs:
sslcheck:
docker:
- image: circleci/python:3.8.0-node
working_directory: ~/repo
steps:
- checkout
- run:
name: Check SSL Certificates
command: |
.circleci/slack-message.sh "*Checking SSL Certificates*" "#FFF000"
sudo pip install -r requirements.txt
OUTPUT=$(./ssl_checker.py -a -f ./hosts_to_check)
echo "$OUTPUT"
if ! echo "$OUTPUT" | grep "Expired: 0" ; then
.circleci/slack-message.sh "*Checked SSL Certificates*: Expired :x:" "#FF0000"
fi
if ! echo "$OUTPUT" | grep "Warning: 0" ; then
.circleci/slack-message.sh "*Checked SSL Certificates*: Warnings :warning:" "#FF0000"
fi
workflows:
version: 2
sslcheck-on-push:
jobs:
- sslcheck:
context: github-backup
filters:
branches:
only: master
sslcheck-on-schedule:
triggers:
- schedule:
cron: "0 22 * * *"
filters:
branches:
only:
- master
jobs:
- sslcheck:
context: github-backup
filters:
branches:
only: master