forked from openedx-unsupported/configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate_templates.sh
executable file
·38 lines (34 loc) · 970 Bytes
/
validate_templates.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
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# This file should be sourced
# The 'root_dir' and 'environment_deployments' variables
# should be set when we source this.
FAIL=0
for e_d in $environment_deployments
do
GREP_DIR="$root_dir/${e_d}"
if ! egrep -q -r --include *.json '{{' "${GREP_DIR}"; then
echo "No un-expanded vars in ${e_d}"
else
echo "Found un-expanded vars in ${e_d}"
echo `egrep -r --include *.json '{{' "${GREP_DIR}"`
FAIL=1
fi
if ! egrep -qi -r --include *.json \'"False"\' "${GREP_DIR}"; then
echo "No quoted False."
else
echo "Found a quoted boolean in ${e_d}"
echo `egrep -qi -r --include *.json "False" "${GREP_DIR}"`
FAIL=1
fi
if ! egrep -qi -r --include *.json '\"True\"' "${GREP_DIR}"; then
echo "No quoted False."
else
echo "Found a quoted boolean in ${e_d}"
echo `egrep -qi -r --include *.json '\"True\"' "${GREP_DIR}"`
FAIL=1
fi
done
if [ "$FAIL" -eq 1 ] ; then
echo "Failing..."
exit 1
fi