diff options
| author | Chmouel Boudjnah <chmouel@enovance.com> | 2014-10-03 09:26:36 +0000 |
|---|---|---|
| committer | Chmouel Boudjnah <chmouel@enovance.com> | 2014-10-03 09:59:19 +0000 |
| commit | ac0b2a797f3a279fb15728def4016f6156ccfe0a (patch) | |
| tree | 785a4208cd483f8d983719a0f5c454731e210ecd /tools | |
| parent | a6310d7692c0fe10e19ca9859b6c4d9754611171 (diff) | |
| download | kolla-ac0b2a797f3a279fb15728def4016f6156ccfe0a.tar.gz kolla-ac0b2a797f3a279fb15728def4016f6156ccfe0a.zip | |
Add validate-json tox target
This is a simple JSON validation script based on demjson python library,
we do some shell script trickeries to exit properly if there is a
failure for tox (should probably patch demjson to properly exit
instead).
Change-Id: I930908336deef7daeaab5b55ba2031c64698d880
Implements: blueprint json-validation-gate
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/validate-json.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/validate-json.sh b/tools/validate-json.sh new file mode 100755 index 000000000..c4d1f3924 --- /dev/null +++ b/tools/validate-json.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +TMPFILE=$(mktemp) +ret=0 + +function clean { + rm -f ${TMPFILE} +} +trap clean EXIT + +for f in $(find docker/ -type f -name '*.json');do + jsonlint -s ${f} >${TMPFILE} + egrep -q 'has errors$' ${TMPFILE} && { cat ${TMPFILE}; ret=1 ;} +done + +cat ${TMPFILE} + +exit ${ret} |
