
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
20 lines
288 B
Bash
Executable File
20 lines
288 B
Bash
Executable File
#!/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}
|