1+ #! /bin/bash
2+
3+ # $1 release
4+ # $2 maven artefacts url (as specified in the vote email)
5+
6+ # ##################
7+ # prerequisites
8+
9+ command -v wget > /dev/null 2>&1 || { echo >&2 " wget needs to be installed" ; exit 1; }
10+ command -v gpg > /dev/null 2>&1 || { echo >&2 " gpg needs to be installed" ; exit 1; }
11+ command -v sha1sum > /dev/null 2>&1 || { echo >&2 " sha1sum needs to be installed" ; exit 1; }
12+ command -v md5sum > /dev/null 2>&1 || { echo >&2 " md5sum needs to be installed" ; exit 1; }
13+ command -v sha256sum > /dev/null 2>&1 || { echo >&2 " sha256sum needs to be installed" ; exit 1; }
14+ command -v sha512sum > /dev/null 2>&1 || { echo >&2 " sha512sum needs to be installed" ; exit 1; }
15+ command -v tar > /dev/null 2>&1 || { echo >&2 " tar needs to be installed" ; exit 1; }
16+ command -v timeout > /dev/null 2>&1 || { echo >&2 " timeout needs to be installed" ; exit 1; }
17+ command -v docker > /dev/null 2>&1 || { echo >&2 " docker needs to be installed" ; exit 1; }
18+ (docker info > /dev/null 2>&1 ) || { echo >&2 " docker needs to running" ; exit 1; }
19+
20+ # ##################
21+
22+ mkdir -p /tmp/$1
23+ cd /tmp/$1
24+ echo " Downloading $2 "
25+ wget -Nqnd -e robots=off --recursive --no-parent $2
26+ echo " Downloading https://dist.apache.org/repos/dist/dev/cassandra/$1 /"
27+ wget -Nqe robots=off --recursive --no-parent https://dist.apache.org/repos/dist/dev/cassandra/$1 /
28+
29+ echo
30+ echo " ====== CHECK RESULTS ======"
31+ echo
32+
33+ for f in * .asc ; do gpg --verify $f ; done
34+ for f in * .pom * .jar * .asc ; do echo -n " sha1: " ; echo " $( cat $f .sha1) $f " | sha1sum -c ; echo -n " md5: " ; echo " $( cat $f .md5) $f " | md5sum -c ; done
35+
36+ cd dist.apache.org/repos/dist/dev/cassandra/$1
37+ for f in * .asc ; do gpg --verify $f ; done
38+ for f in * .gz ; do echo -n " sha256: " ; echo " $( cat $f .sha256) $f " | sha256sum -c ; echo -n " sha512:" ; echo " $( cat $f .sha512) $f " | sha512sum -c ; done
39+
40+ echo
41+ tar -xjf apache-cassandra-$1 -src.tar.gz
42+ pushd apache-cassandra-$1 -src > /dev/null
43+ echo " Source build $( ant artifacts | grep ' ^BUILD ' ) "
44+ popd > /dev/null
45+
46+ echo
47+ tar -xjf apache-cassandra-$1 -bin.tar.gz
48+ rm -f procfifo
49+ mkfifo procfifo
50+ timeout 30 apache-cassandra-$1 /bin/cassandra -f 2>&1 > procfifo &
51+ PID=$!
52+ success=false
53+ while read LINE && ! $success ; do
54+ if [[ $LINE =~ " Starting listening for CQL clients on" ]] ; then
55+ echo " Binary artefact OK"
56+ kill " $PID "
57+ success=true
58+ fi
59+ done < procfifo
60+ rm -f procfifo
61+ wait " $PID "
62+ if ! $success ; then
63+ echo " Binary artefact FAILED"
64+ fi
65+
66+ echo
67+ rm -f procfifo
68+ mkfifo procfifo
69+ docker run -i -v ` pwd` /debian:/debian openjdk:8-jdk-slim-buster timeout 60 /bin/bash -c " ( apt -qq update; apt -qq install -y python; dpkg --ignore-depends=java7-runtime --ignore-depends=java8-runtime -i debian/*.deb ) 2>/dev/null; CASSANDRA_CONF=file:///etc/cassandra/ HEAP_NEWSIZE=500m MAX_HEAP_SIZE=1g cassandra -R -f" 2>&1 > procfifo &
70+ PID=$!
71+ success=false
72+ while read LINE && ! $success ; do
73+ if [[ $LINE =~ " Starting listening for CQL clients on" ]] ; then
74+ echo " Debian package OK"
75+ kill " $PID "
76+ success=true
77+ fi
78+ done < procfifo
79+ rm -f procfifo
80+ wait " $PID "
81+ if ! $success ; then
82+ echo " Debian package FAILED"
83+ fi
84+
85+ echo
86+ rm -f procfifo
87+ mkfifo procfifo
88+ docker run -i -v ` pwd` /redhat:/redhat centos timeout 60 /bin/bash -c " ( yum install -y java-1.8.0-openjdk ; rpm -i redhat/*.rpm ) 2>/dev/null; cassandra -R -f " 2>&1 > procfifo &
89+ PID=$!
90+
91+ success=false
92+ while read LINE && ! $success ; do
93+ if [[ $LINE =~ " Starting listening for CQL clients on" ]] ; then
94+ echo " Redhat package OK"
95+ kill " $PID "
96+ success=true
97+ fi
98+ done < procfifo
99+ rm -f procfifo
100+ wait " $PID "
101+ if ! $success ; then
102+ echo " Redhat package FAILED"
103+ fi
0 commit comments