Skip to content
Snippets Groups Projects
Commit 330541fe authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Add support to lint the install commands in Dockerfiles"

parents b397cd72 eb1bfc2c
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,8 @@ echo "=== json checks ===" ...@@ -37,8 +37,8 @@ echo "=== json checks ==="
${TOPLEVEL}/tools/validate-all-json.sh || RES=1 ${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 exit $RES
...@@ -5,3 +5,7 @@ cd "$(dirname "$REAL_PATH")/.." ...@@ -5,3 +5,7 @@ cd "$(dirname "$REAL_PATH")/.."
find docker -name Dockerfile.j2 -print0 | find docker -name Dockerfile.j2 -print0 |
xargs -0 tools/validate-maintainer.sh || exit 1 xargs -0 tools/validate-maintainer.sh || exit 1
find docker -name Dockerfile.j2 -print0 |
xargs -0 tools/validate-install-command.sh || exit 1
#!/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
...@@ -23,7 +23,7 @@ commands = ...@@ -23,7 +23,7 @@ commands =
flake8 {posargs} flake8 {posargs}
{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 {toxinidir}/tools/validate-all-dockerfiles.sh
[testenv:bandit] [testenv:bandit]
commands = bandit -r ansible/library dev docker kolla tests tools commands = bandit -r ansible/library dev docker kolla tests tools
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment