From f07bfe0b1d4d15b76187df0d1a166fbc92b374bf Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 28 Aug 2024 17:59:46 +0100 Subject: [PATCH] ci: Use new arguments to ci-kdl to avoid child management Instead of using a tee to the log, step the verbosity down - we already know by this point that it's working pretty well. Passing --output-file directly also lets us avoid a messy 'mv'. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/common/kdl.sh | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci/common/kdl.sh b/.gitlab-ci/common/kdl.sh index 394291b7c7d..0459d8e76d5 100755 --- a/.gitlab-ci/common/kdl.sh +++ b/.gitlab-ci/common/kdl.sh @@ -1,24 +1,18 @@ #!/usr/bin/env bash # shellcheck disable=SC1091 # the path is created in build-kdl and # here is check if exist +# shellcheck disable=SC2086 # we want the arguments to be expanded -terminate() { - echo "ci-kdl.sh caught SIGTERM signal! propagating to child processes" - for job in $(jobs -p) - do - kill -15 "$job" - done -} - -trap terminate SIGTERM - -if [ -f /ci-kdl/bin/activate ]; then - source /ci-kdl/bin/activate - /ci-kdl/bin/python /ci-kdl/bin/ci-kdl | tee -a "$RESULTS_DIR/kdl.log" & - child=$! - wait $child - mv kdl_*.json "$RESULTS_DIR/kdl.json" -else - echo -e "Not possible to activate ci-kdl virtual environment" +if ! [ -f /ci-kdl/bin/activate ]; then + echo -e "ci-kdl not installed; not monitoring temperature" + exit 0 fi +KDL_ARGS=" + --output-file=${RESULTS_DIR}/kdl.json + --log-level=WARNING + --num-samples=-1 +" + +source /ci-kdl/bin/activate +exec /ci-kdl/bin/ci-kdl ${KDL_ARGS}