From 2597fcf82a92099b4a1de6bc7c304bf36b7b3818 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 26 Aug 2021 12:37:32 +0200 Subject: [PATCH] Jenkins: get-assets.sh: show a bit more debug output * S3_DOWNLOAD_HOST variable was still pointing to assets.dev.lgsvlsimulator.com which was shutdown on July 18th and now all asset bundle builds were failing without any useful output when FORCE_REBUILD wasn't enabled, because this script runs with "set -e" and curl was returning error: 6 Couldn't resolve host. The given remote host was not resolved. so the Jenkins build suddenly failed without any output: 12:13:24 > git lfs pull origin # timeout=10 12:13:25 Commit message: "update mats" [Pipeline] echo 12:13:25 INFO: Checked out following Environments: CubeTown,... [Pipeline] sh 12:13:25 > git rev-list --no-walk e030b652049c9ae0af4978d7cdf3d64933167c7f # timeout=10 12:13:25 SUBFOLDERS=CubeTown ... [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Checkout Vehicles) Stage "Checkout Vehicles" skipped due to earlier failure(s) only after adding -x to get-assets it was showing reasonable output to figure out what went wrong: 12:58:48 ++ basename Assets/External/Environments/CubeTown 12:58:48 + NAME=CubeTown 12:58:48 + [[ ! CubeTown =~ @tmp ]] 12:58:48 ++ GIT_DIR=Assets/External/Environments/CubeTown/.git 12:58:48 ++ git rev-parse HEAD 12:58:48 + ID=d1acb0b59326407c91906cb3a0a3901286adc984 12:58:48 + '[' 0 -eq 1 ']' 12:58:48 ++ curl -sILw '%{http_code}\n' https://assets.dev.lgsvlsimulator.com/v2/d1acb0b59326407c91906cb3a0a3901286adc984/environment_CubeTown -o /dev/null 12:58:48 + CHECK=000 [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Checkout Vehicles) Stage "Checkout Vehicles" skipped due to earlier failure(s) include enough output to show what this script is doing during the build (without all the clutter from -x). --- Jenkins/get-assets.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkins/get-assets.sh b/Jenkins/get-assets.sh index bbc4a721c..ee10d12be 100755 --- a/Jenkins/get-assets.sh +++ b/Jenkins/get-assets.sh @@ -55,12 +55,15 @@ for f in $(list_folders); do if [ "${ALL}" -eq "1" ]; then echo $ID $NAME else - CHECK=`curl -sILw '%{http_code}\n' "https://${URL}/${ID}/${PREFIX}_${NAME}" -o /dev/null` + CHECK=`curl -sILw '%{http_code}\n' "https://${URL}/${ID}/${PREFIX}_${NAME}" -o /dev/null || true` if [ "${CHECK}" -ne "200" ]; then + echo "https://${URL}/${ID}/${PREFIX}_${NAME} doesn't exist, include it in the build" >&2 echo $ID $NAME + else + echo "https://${URL}/${ID}/${PREFIX}_${NAME} does exist, skip building it (you can use FORCE_REBUILD to rebuild existing assets)" >&2 fi fi - + else + continue fi - done