Add markup for headings in logs

This commit is contained in:
Manuel Thalmann 2023-03-25 19:50:24 +01:00
parent 56601510e2
commit b391602c67

View file

@ -43,6 +43,13 @@ RUN \
|| true || true
RUN \ RUN \
printHeading() { \
local heading; \
heading="====================================================="; \
echo "$heading"; \
[ -z "$1" ] && cat || echo "$1"; \
echo "$heading"; \
}; \
wget "${KEIL_URL}" --progress=bar:force:noscroll -O MDK537.exe; \ wget "${KEIL_URL}" --progress=bar:force:noscroll -O MDK537.exe; \
[ $DEBUG -eq 1 ] && { \ [ $DEBUG -eq 1 ] && { \
mkdir -p logs; \ mkdir -p logs; \
@ -75,7 +82,7 @@ RUN \
}; \ }; \
# Run actual MDK537 installer # Run actual MDK537 installer
install_keil() { \ install_keil() { \
echo "Starting ARM Keil installation"; \ printHeading "Starting ARM Keil installation"; \
try="$1"; \ try="$1"; \
logFile="$(mktemp)"; \ logFile="$(mktemp)"; \
# Run installer asynchronously # Run installer asynchronously
@ -128,12 +135,14 @@ RUN \
[ "$exitCode" -eq 42 ] && mv "$logFile" "logs/timeout-handled-try$try.log"; \ [ "$exitCode" -eq 42 ] && mv "$logFile" "logs/timeout-handled-try$try.log"; \
[ "$exitCode" -ne 0 ] && mv "$logFile" "logs/fail-try$try.log"; \ [ "$exitCode" -ne 0 ] && mv "$logFile" "logs/fail-try$try.log"; \
}; \ }; \
{ \
[ "$exitCode" -ne 0 ] && { \ [ "$exitCode" -ne 0 ] && { \
[ "$exitCode" -eq 42 ] && echo "The installation Got Stuck" || \ [ "$exitCode" -eq 42 ] && echo "The installation Got Stuck" || \
echo "The Installation Failed"; \ echo "The Installation Failed"; \
} || \ } || \
echo "The Installation Was Successful"; \ echo "The Installation Was Successful"; \
echo "Installation Process Exited With Code $exitCode"; \ echo "Installation Process Exited With Code $exitCode"; \
} | printHeading; \
return "$exitCode"; \ return "$exitCode"; \
}; \ }; \
display=:90; \ display=:90; \
@ -158,7 +167,7 @@ RUN \
"$y" \ "$y" \
; \ ; \
do \ do \
echo "Restarting Installation"; \ printHeading "Restarting Installation"; \
# Increase counter # Increase counter
y="$(expr "$y" + 1)"; \ y="$(expr "$y" + 1)"; \
done && \ done && \