activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [activemq] branch activemq-5.16.x updated: [AMQ-8090] Add a release validation script
Date Wed, 02 Dec 2020 12:57:48 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.16.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.16.x by this push:
     new 313f280  [AMQ-8090] Add a release validation script
313f280 is described below

commit 313f280fb8ee08a0b00c40829f3c8a319d1461dd
Author: Matt Pavlovich <matt@hyte.io>
AuthorDate: Fri Nov 27 11:21:59 2020 -0600

    [AMQ-8090] Add a release validation script
    
    (cherry picked from commit 3218a93ba2a76244225833cf4b6d3874886c84ae)
---
 committer-tools/release-validate.sh | 103 ++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/committer-tools/release-validate.sh b/committer-tools/release-validate.sh
new file mode 100755
index 0000000..1aba736
--- /dev/null
+++ b/committer-tools/release-validate.sh
@@ -0,0 +1,103 @@
+#!/bin/bash
+
+export MVN_REPO=https://repo1.maven.org/maven2
+
+export CMD_CURL=/usr/bin/curl
+export CMD_MD5SUM=/sbin/md5
+export CMD_SHASUM=/usr/bin/shasum
+export CMD_TAR=/usr/bin/tar
+export CMD_UNZIP=/usr/bin/unzip
+
+download_media() {
+
+  echo -n "Downloading ActiveMQ version: $1 type: $2..."
+  CURL_DL_OUT=`$CMD_CURL -s -o apache-activemq-$1-bin.$2 $MVN_REPO/org/apache/activemq/apache-activemq/$1/apache-activemq-$1-bin.$2`
+  echo "done"
+
+  for kind in sha1 md5
+  do 
+    echo -n "Downloading ActiveMQ version: $1 type: $2 $kind checksum ..."
+    CURL_DL_CHKSUM_OUT=`$CMD_CURL -s -o apache-activemq-$1-bin.$2.$kind $MVN_REPO/org/apache/activemq/apache-activemq/$1/apache-activemq-$1-bin.$2.$kind`
+    echo "done"
+
+    echo -n "Validating $kind checksum ..."
+
+    if [ $kind = "sha1" ]; then
+      DL_CHKSUM=`$CMD_SHASUM apache-activemq-$1-bin.$2 | cut -f1 -d" "`
+    elif [ $kind = "md5" ]; then
+      DL_CHKSUM=`$CMD_MD5SUM -q apache-activemq-$1-bin.$2 | cut -f1 -d" "`
+    fi
+    VL_CHKSUM=`cut -f1 -d" " apache-activemq-$1-bin.$2.$kind`
+
+    if [[ "$DL_CHKSUM" != "$VL_CHKSUM" ]]; then
+      echo "ERROR: $kind checksum mismatch expected: $VL_CHKSUM calculated: $DL_CHKSUM"
+      exit 1;
+    fi
+    echo "done"
+  done
+
+}
+
+extract_media() {
+  echo -n "Extracting $2 media ..."
+
+  if [ $2 = "tar.gz" ]; then
+    EXTRACT_OUT=`$CMD_TAR xzf apache-activemq-$1-bin.$2`
+  elif [ $2 = "zip" ]; then
+    EXTRACT_OUT=`$CMD_UNZIP apache-activemq-$1-bin.$2`
+  fi
+
+  if [[ $? -ne 0 ]]; then
+    echo "$2 extract failed!"
+    exit 1
+  fi 
+  echo "done"
+}
+
+cleanup_media() {
+  echo -n "Cleaning up $2 media ...":
+  rm apache-activemq-$1-bin.$2.sha1
+  rm apache-activemq-$1-bin.$2.md5
+  rm apache-activemq-$1-bin.$2
+  rm -rf apache-activemq-$1
+  echo "done"
+}
+
+if [ -z ${1+x} ]; then
+  echo "Using default maven repo: $MVN_REPO"
+else 
+  export MVN_REPO=$1
+  echo "Using maven repo: $MVN_REPO"
+fi
+
+VERSIONS=()
+CURL_OUT=`$CMD_CURL -o index.html -s $MVN_REPO/org/apache/activemq/apache-activemq/`
+
+for i in `grep href index.html | grep -v maven-metadata | grep -v "\.\." | cut -f2 -d= |
cut -f1 -d"/" | cut -f2 -d"\"" | sort -rV | grep -v -E '5.1.[0-9+]|5.8'`;
+do 
+  if [[ $i =~ 5.1[5-9]+ ]]; then
+    VERSIONS+=($i)
+  fi
+done
+
+rm index.html
+
+VERSIONS+=("Quit")
+
+PS3='Install ActiveMQ version: '
+select opt in "${VERSIONS[@]}"
+do
+  case $opt in
+    "Quit")
+      break;;
+  *) 
+    for type in tar.gz zip
+    do
+      download_media $opt $type
+      extract_media $opt $type
+      cleanup_media $opt $type
+    done
+    break;;
+  esac
+done
+


Mime
View raw message