Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions hadoop-ozone/dev-support/checks/hadolint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR/../../.." || exit 1
REPO_DIR="$DIR/../../.."

ERROR=0


for Dockerfile in $(find "$REPO_DIR/hadoop-ozone" "$REPO_DIR/hadoop-hdds" -name Dockerfile | sort); do
echo "Checking $Dockerfile"
REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/hadolint"}
mkdir -p "$REPORT_DIR"
REPORT_FILE="$REPORT_DIR/summary.txt"
Comment thread
symious marked this conversation as resolved.

for Dockerfile in $(find hadoop-ozone hadoop-hdds -name Dockerfile | sort); do
result=$( hadolint $Dockerfile )
if [ ! -z "$result" ]
then
echo "$result"
echo ""
ERROR=1
echo "$result" | tee -a "$REPORT_FILE"
fi
Comment thread
symious marked this conversation as resolved.
Outdated
done

if [ "$ERROR" = 1 ]
wc -l "$REPORT_FILE" | awk '{print $1}'> "$REPORT_DIR/failures"

if [ -s "${REPORT_FILE}" ]
then
echo ""
echo ""
echo "Hadolint errors were found. Exit code: 1."
echo "" | tee -a "$REPORT_FILE"
echo "" | tee -a "$REPORT_FILE"
echo "Hadolint errors were found. Exit code: 1." | tee -a "$REPORT_FILE"
exit 1
fi