Skip to content

Commit

Permalink
Jenkins: get-assets.sh: show a bit more debug output
Browse files Browse the repository at this point in the history
* 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).
  • Loading branch information
shr-project committed Aug 27, 2021
1 parent 4656555 commit 2597fcf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Jenkins/get-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2597fcf

Please sign in to comment.