diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-11-12 16:42:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-11-12 16:42:51 +0000 |
| commit | c569335e800735099e3ae1b3ef7c35f020ee1c3c (patch) | |
| tree | 8862d0879ffb98394ce324bdd6f3bf345b23d33f /tools | |
| parent | 3c7ef7a45b0ff1af91ab9d51272aeae5e35aa5c5 (diff) | |
| parent | 6666d1e973b4dd2b5bf22970cfcc53d77007a3e8 (diff) | |
| download | kolla-c569335e800735099e3ae1b3ef7c35f020ee1c3c.tar.gz kolla-c569335e800735099e3ae1b3ef7c35f020ee1c3c.zip | |
Merge "add maintainer check to tests"
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/pre-commit-hook | 14 | ||||
| -rwxr-xr-x | tools/validate-all-maintainer.sh | 9 | ||||
| -rwxr-xr-x | tools/validate-maintainer.sh | 14 |
3 files changed, 33 insertions, 4 deletions
diff --git a/tools/pre-commit-hook b/tools/pre-commit-hook index 699cb978e..475e05912 100755 --- a/tools/pre-commit-hook +++ b/tools/pre-commit-hook @@ -33,13 +33,19 @@ find . -type f -print0 | echo "=== yaml checks ===" 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 ===" find . -name '*.json' -print0 | - xargs -0 -n1 --no-run-if-empty python -mjson.tool \ - || RES=1 + xargs -0 --no-run-if-empty ${TOPLEVEL}/tools/validate-json.py \ + || RES=1 -exit $RES +echo "=== maintainer checks ===" + +find . -name Dockerfile -print0 | + xargs -0 --no-run-if-empty ${TOPLEVEL}/tools/validate-maintainer \ + || RES=1 +exit $RES diff --git a/tools/validate-all-maintainer.sh b/tools/validate-all-maintainer.sh new file mode 100755 index 000000000..a488385a1 --- /dev/null +++ b/tools/validate-all-maintainer.sh @@ -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 + diff --git a/tools/validate-maintainer.sh b/tools/validate-maintainer.sh new file mode 100755 index 000000000..d6bb75a84 --- /dev/null +++ b/tools/validate-maintainer.sh @@ -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 + |
