Skip to content

Instantly share code, notes, and snippets.

@RaulGracia
Last active February 4, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RaulGracia/74594ef8d434f4d173dec508c828e382 to your computer and use it in GitHub Desktop.
Save RaulGracia/74594ef8d434f4d173dec508c828e382 to your computer and use it in GitHub Desktop.
# Release and Tag for the release to check
RELEASE_VERSION="0.9.0"
RELEASE_TAG="v$RELEASE_VERSION-rc1"
echo "RELEASE VERSION: $RELEASE_VERSION"
echo "TAG VERSION: $RELEASE_TAG"
# Iterate over all the artifacts in the release
for ARTIFACT in "pravega-$RELEASE_VERSION.tgz" "pravega-$RELEASE_VERSION.zip" "pravega-client-$RELEASE_VERSION.tgz" "pravega-client-$RELEASE_VERSION.zip" "pravega-javadoc-$RELEASE_VERSION.tgz" "pravega-javadoc-$RELEASE_VERSION.zip"
do
# Download artifact to check
echo $ARTIFACT
wget -q --show-progress https://github.com/pravega/pravega/releases/download/$RELEASE_TAG/$ARTIFACT
# MD5 check
wget -q --show-progress https://github.com/pravega/pravega/releases/download/$RELEASE_TAG/$ARTIFACT.md5
INTEGRITY_CHECK="0"
INTEGRITY_CHECK=$(cat $ARTIFACT.md5 | md5sum -c | grep -q OK; [ $? -eq 0 ] && echo "1" || echo "0")
if [[ $INTEGRITY_CHECK == "0" ]]; then
echo "EXITING DUE TO WRONG MD5 CHECKSUM"
exit 1
fi
# SHA1 check
wget -q --show-progress https://github.com/pravega/pravega/releases/download/$RELEASE_TAG/$ARTIFACT.sha1
INTEGRITY_CHECK="0"
INTEGRITY_CHECK=$(cat $ARTIFACT.sha1 | sha1sum -c | grep -q OK; [ $? -eq 0 ] && echo "1" || echo "0")
if [[ $INTEGRITY_CHECK == "0" ]]; then
echo "EXITING DUE TO WRONG SHA1 CHECKSUM"
exit 1
fi
# SHA256 check
wget https://github.com/pravega/pravega/releases/download/$RELEASE_TAG/$ARTIFACT.sha256
INTEGRITY_CHECK="0"
INTEGRITY_CHECK=$(cat $ARTIFACT.sha256 | sha256sum -c | grep -q OK; [ $? -eq 0 ] && echo "1" || echo "0")
if [[ $INTEGRITY_CHECK == "0" ]]; then
echo "EXITING DUE TO WRONG SHA256 CHECKSUM"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment