-
Notifications
You must be signed in to change notification settings - Fork 1
/
monitoring.sh
executable file
·25 lines (18 loc) · 939 Bytes
/
monitoring.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
date;
cd $(dirname $0);
wget -e robots=off -m -E -q -A.html "https://staging.api.groundspeak.com/documentation" -O "staging/documentation.html"
wget -e robots=off -m -E -q -A.html "https://staging.api.groundspeak.com/api-docs/v1/swagger" -O "staging/swagger.json"
wget -e robots=off -m -E -q -A.html "https://api.groundspeak.com/documentation" -O "production/documentation.html"
wget -e robots=off -m -E -q -A.html "https://api.groundspeak.com/api-docs/v1/swagger" -O "production/swagger.json"
SWAGGER_FILES=$(git ls-files -m | grep -E 'swagger.json');
php swaggerSort.php $SWAGGER_FILES
if [[ $(git ls-files -m | grep -E 'staging|production' | wc -l) -gt 0 ]];then
FILES=$(git ls-files -m | grep -E 'staging|production');
printf "Files found:\n%s\n\n" "$FILES";
git commit --author "Surfoo <[email protected]>" -am "Changes detected on:
$FILES" && git push;
else
printf 'Nothing to do.\n\n';
fi
exit 0;