diff options
| author | Swapnil Kulkarni (coolsvap) <me@coolsvap.net> | 2016-05-17 15:39:25 +0530 |
|---|---|---|
| committer | Swapnil Kulkarni (coolsvap) <me@coolsvap.net> | 2016-05-26 17:41:42 +0530 |
| commit | eb1bfc2c2e157e90a57f2a0f5186db0dea4c3909 (patch) | |
| tree | d1687940c6a2bd1e356f89ae8b3500decbaaca7d /tools/validate-install-command.sh | |
| parent | b40bf517aeb894ed4b79985f66405507e0725ebd (diff) | |
| download | kolla-eb1bfc2c2e157e90a57f2a0f5186db0dea4c3909.tar.gz kolla-eb1bfc2c2e157e90a57f2a0f5186db0dea4c3909.zip | |
Add support to lint the install commands in Dockerfiles
Change-Id: Icb47ba8b13b13889e28bb285321f11344400edc2
Closes-Bug:#1582618
Diffstat (limited to 'tools/validate-install-command.sh')
| -rwxr-xr-x | tools/validate-install-command.sh | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
