From 3518006e7520d9e089ded1bbf2d112af4aeb77e8 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis Date: Thu, 23 Nov 2023 12:14:19 -0500 Subject: [PATCH] Enable Shell-Check for circle CI scripts --- .shellcheck_exclude_paths | 2 -- scripts/ci/circle/postCDashStatus.sh | 7 ++++--- scripts/ci/circle/run.sh | 11 +++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.shellcheck_exclude_paths b/.shellcheck_exclude_paths index 1ef95d56a2..4f77bacc4d 100644 --- a/.shellcheck_exclude_paths +++ b/.shellcheck_exclude_paths @@ -1,5 +1,3 @@ -scripts/ci/circle/postCDashStatus.sh -scripts/ci/circle/run.sh scripts/ci/gh-actions/check-branch-name.sh scripts/ci/gh-actions/get-changed-files.sh scripts/ci/gh-actions/macos-setup.sh diff --git a/scripts/ci/circle/postCDashStatus.sh b/scripts/ci/circle/postCDashStatus.sh index 800b192d77..031ae912cc 100755 --- a/scripts/ci/circle/postCDashStatus.sh +++ b/scripts/ci/circle/postCDashStatus.sh @@ -4,7 +4,7 @@ USER=${STATUS_ROBOT_NAME} TOKEN=${STATUS_ROBOT_KEY} COMMIT=${CIRCLE_SHA1} CDASH_STATUS_CONTEXT="cdash" -SOURCE_DIR="$(readlink -f ${CIRCLE_WORKING_DIRECTORY}/source)" +SOURCE_DIR="$(readlink -f "${CIRCLE_WORKING_DIRECTORY}"/source)" build_status_body() { cat < /dev/null)" - if [ $? -eq 0 ] + RESULT="$(curl -s "${APIURL}" | python3 -c "import sys, json; print(json.load(sys.stdin)['head']['ref'])" 2> /dev/null)" + exit_status=$? + if [ "$exit_status" -eq 0 ] then REALBRANCH="$(echo "${RESULT}" | tr '/' '-')" fi @@ -70,8 +72,9 @@ echo "**********Env End************" echo "**********CTest Begin**********" ${CTEST} --version -echo ${CTEST} -VV -S ${CTEST_SCRIPT} -Ddashboard_full=OFF ${CTEST_STEP_ARGS} -${CTEST} -VV -S ${CTEST_SCRIPT} -Ddashboard_full=OFF ${CTEST_STEP_ARGS} +echo ${CTEST} -VV -S "${CTEST_SCRIPT}" -Ddashboard_full=OFF "${CTEST_STEP_ARGS}" +# shellcheck disable=SC2086 +${CTEST} -VV -S "${CTEST_SCRIPT}" -Ddashboard_full=OFF ${CTEST_STEP_ARGS} RET=$? echo "**********CTest End************"