add maintainer check to tests
Change-Id: I6ee985e694142aa7dadeb085b77910667ac6359f
This commit is contained in:
parent
277f2448e8
commit
6666d1e973
@ -33,13 +33,19 @@ find . -type f -print0 |
|
|||||||
echo "=== yaml checks ==="
|
echo "=== yaml checks ==="
|
||||||
|
|
||||||
find . -name '*.yaml' -print0 |
|
find . -name '*.yaml' -print0 |
|
||||||
xargs -0 --no-run-if-empty python ${TOPLEVEL}/tools/try-parse-yaml.py
|
xargs -0 --no-run-if-empty ${TOPLEVEL}/tools/validate-yaml.py \
|
||||||
|
|| RES = 1
|
||||||
|
|
||||||
echo "=== json checks ==="
|
echo "=== json checks ==="
|
||||||
|
|
||||||
find . -name '*.json' -print0 |
|
find . -name '*.json' -print0 |
|
||||||
xargs -0 -n1 --no-run-if-empty python -mjson.tool \
|
xargs -0 --no-run-if-empty ${TOPLEVEL}/tools/validate-json.py \
|
||||||
|| RES=1
|
|| RES=1
|
||||||
|
|
||||||
|
echo "=== maintainer checks ==="
|
||||||
|
|
||||||
|
find . -name Dockerfile -print0 |
|
||||||
|
xargs -0 --no-run-if-empty ${TOPLEVEL}/tools/validate-maintainer \
|
||||||
|
|| RES=1
|
||||||
|
|
||||||
exit $RES
|
exit $RES
|
||||||
|
|
||||||
|
9
tools/validate-all-maintainer.sh
Executable file
9
tools/validate-all-maintainer.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TOPLEVEL=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
cd $TOPLEVEL
|
||||||
|
|
||||||
|
git ls-files -z '*/Dockerfile' |
|
||||||
|
xargs -0 tools/validate-maintainer.sh || exit 1
|
||||||
|
|
14
tools/validate-maintainer.sh
Executable file
14
tools/validate-maintainer.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
MAINTANER='MAINTAINER Kolla Project (https://launchpad.net/kolla)'
|
||||||
|
RES=0
|
||||||
|
|
||||||
|
for dockerfile in "$@"; do
|
||||||
|
if ! grep -q "$MAINTAINER" "$dockerfile"; then
|
||||||
|
echo "ERROR: $dockerfile has incorrect MAINTAINER" >&2
|
||||||
|
RES=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $RES
|
||||||
|
|
1
tox.ini
1
tox.ini
@ -10,3 +10,4 @@ deps = -r{toxinidir}/test-requirements.txt
|
|||||||
commands =
|
commands =
|
||||||
{toxinidir}/tools/validate-all-json.sh
|
{toxinidir}/tools/validate-all-json.sh
|
||||||
{toxinidir}/tools/validate-all-yaml.sh
|
{toxinidir}/tools/validate-all-yaml.sh
|
||||||
|
{toxinidir}/tools/validate-all-maintainer.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user