From: Anil Belur Date: Tue, 26 Jul 2022 21:20:50 +0000 (+1000) Subject: Fix: Ignore unbounded variable BUILD_RESULT X-Git-Tag: v0.79.1^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F70413%2F3;p=releng%2Fglobal-jjb.git Fix: Ignore unbounded variable BUILD_RESULT Error: BUILD_RESULT: unbound variable Change-Id: Iefbf3d6f658632990529015f35336cadb65e379c Signed-off-by: Anil Belur --- diff --git a/shell/job-cost.sh b/shell/job-cost.sh index e5e18106..85096cdd 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -76,7 +76,7 @@ else fi # Archive the cost date -mkdir -p "$WORKSPACE/archives/cost" +mkdir -p "${WORKSPACE}/archives/cost" echo "INFO: Archiving Costs" @@ -85,5 +85,5 @@ echo "INFO: Archiving Costs" date=$(TZ=GMT date +'%Y-%m-%d %H:%M:%S') # Format the uptime, cost & stack_cost fields -printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "$JOB_NAME" "$BUILD_NUMBER" "$date" \ - "$resource" "$uptime" "$cost" "$stack_cost" "$BUILD_RESULT" > "$WORKSPACE/archives/cost.csv" +printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "${JOB_NAME:-}" "${BUILD_NUMBER:-}" "$date" \ + "$resource" "$uptime" "$cost" "$stack_cost" "${BUILD_RESULT:-}" > "${WORKSPACE}/archives/cost.csv"