From b391602c6791f3bdad0e0fad93acc9681a298b53 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 25 Mar 2023 19:50:24 +0100 Subject: [PATCH] Add markup for headings in logs --- Dockerfile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6d478ae..587d163 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,6 +43,13 @@ RUN \ || true RUN \ + printHeading() { \ + local heading; \ + heading="====================================================="; \ + echo "$heading"; \ + [ -z "$1" ] && cat || echo "$1"; \ + echo "$heading"; \ + }; \ wget "${KEIL_URL}" --progress=bar:force:noscroll -O MDK537.exe; \ [ $DEBUG -eq 1 ] && { \ mkdir -p logs; \ @@ -75,7 +82,7 @@ RUN \ }; \ # Run actual MDK537 installer install_keil() { \ - echo "Starting ARM Keil installation"; \ + printHeading "Starting ARM Keil installation"; \ try="$1"; \ logFile="$(mktemp)"; \ # Run installer asynchronously @@ -128,12 +135,14 @@ RUN \ [ "$exitCode" -eq 42 ] && mv "$logFile" "logs/timeout-handled-try$try.log"; \ [ "$exitCode" -ne 0 ] && mv "$logFile" "logs/fail-try$try.log"; \ }; \ - [ "$exitCode" -ne 0 ] && { \ - [ "$exitCode" -eq 42 ] && echo "The installation Got Stuck" || \ - echo "The Installation Failed"; \ - } || \ - echo "The Installation Was Successful"; \ - echo "Installation Process Exited With Code $exitCode"; \ + { \ + [ "$exitCode" -ne 0 ] && { \ + [ "$exitCode" -eq 42 ] && echo "The installation Got Stuck" || \ + echo "The Installation Failed"; \ + } || \ + echo "The Installation Was Successful"; \ + echo "Installation Process Exited With Code $exitCode"; \ + } | printHeading; \ return "$exitCode"; \ }; \ display=:90; \ @@ -158,7 +167,7 @@ RUN \ "$y" \ ; \ do \ - echo "Restarting Installation"; \ + printHeading "Restarting Installation"; \ # Increase counter y="$(expr "$y" + 1)"; \ done && \