aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pre-commit-hook4
-rwxr-xr-xtools/validate-all-dockerfiles.sh (renamed from tools/validate-all-maintainer.sh)4
-rwxr-xr-xtools/validate-install-command.sh12
3 files changed, 18 insertions, 2 deletions
diff --git a/tools/pre-commit-hook b/tools/pre-commit-hook
index a3c45b757..be7bc6db3 100755
--- a/tools/pre-commit-hook
+++ b/tools/pre-commit-hook
@@ -37,8 +37,8 @@ echo "=== json checks ==="
${TOPLEVEL}/tools/validate-all-json.sh || RES=1
-echo "=== maintainer checks ==="
+echo "=== dockerfile checks ==="
-${TOPLEVEL}/tools/validate-all-maintainer.sh || RES=1
+${TOPLEVEL}/tools/validate-all-dockerfiles || RES=1
exit $RES
diff --git a/tools/validate-all-maintainer.sh b/tools/validate-all-dockerfiles.sh
index 32ac477ee..5a39d24c0 100755
--- a/tools/validate-all-maintainer.sh
+++ b/tools/validate-all-dockerfiles.sh
@@ -5,3 +5,7 @@ cd "$(dirname "$REAL_PATH")/.."
find docker -name Dockerfile.j2 -print0 |
xargs -0 tools/validate-maintainer.sh || exit 1
+
+find docker -name Dockerfile.j2 -print0 |
+ xargs -0 tools/validate-install-command.sh || exit 1
+
diff --git a/tools/validate-install-command.sh b/tools/validate-install-command.sh
new file mode 100755
index 000000000..bc7409690
--- /dev/null
+++ b/tools/validate-install-command.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+RES=0
+
+for dockerfile in "$@"; do
+ if grep "apt-get install\|yum install" "$dockerfile"; then
+ echo "ERROR: $dockerfile has incorrectly formatted install command Should be in the form 'apt-get|yum -y install ...'" >&2
+ RES=1
+ fi
+done
+
+exit $RES