Skip to content

Commit

Permalink
jenkins: handle no matches in download-test.sh (#3113)
Browse files Browse the repository at this point in the history
If no matches for `NODE_VERSION` are found, bail out of the script.
Previously if no matches were found the following rsync would attempt
to download the entire `downloadDir`, e.g., for `release`, every
release we've done!
  • Loading branch information
richardlau authored Dec 16, 2022
1 parent 104363d commit fdd07c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jenkins/download-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ fi
# If the provided NODE_VERSION is inexact, e.g. `v8`, get the most recent matching version.
LINK=`rsync rsync://unencrypted.nodejs.org/nodejs/$downloadDir/ | grep $NODE_VERSION | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1 | awk '{print $5}'`

if [ -z "$LINK" ]; then
echo "No matches found for '$NODE_VERSION' in https://unencrypted.nodejs.org/nodejs/$downloadDir/"
exit 1
fi

# Remove old files
rm -rf v*
[ "$tapFile" ] && rm -rf "$tapFile" && echo "TAP version 13" > $tapFile
Expand Down

0 comments on commit fdd07c7

Please sign in to comment.