kolla/tools/validate-indentation.sh
Jon Schlueter 2b023ba13e validate-indentation: expand check to also catch macros.install_packages
Fixed up 5 Dockerfile.j2 files that had the issue

Change-Id: I8a5551050a75d64712c36d53573437a18777a82f
2018-07-26 14:51:41 -04:00

20 lines
502 B
Bash
Executable File

#!/bin/bash
RES=0
for dockerfile in "$@"; do
if grep -qE '^\s+[[:upper:]]+\s+' "$dockerfile"; then
echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
grep -E '^\s+[[:upper:]]+\s+' "$dockerfile"
RES=1
fi
if grep -qE '^\s+\{\{ macros\.install_packages' "$dockerfile"; then
echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
grep -E '^\s+\{\{ macros\.install_packages' "$dockerfile"
RES=1
fi
done
exit $RES