Skip to content

Commit 051de20

Browse files
committed
fix3
1 parent 4f14875 commit 051de20

File tree

3 files changed

+69
-15
lines changed

3 files changed

+69
-15
lines changed

pipelines/upgrade-testing/check_upgrade.sh

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
11
#!/bin/bash
2+
23
UPGRADE_URL=s3://splice-snapshots/upgrade_tests
34

4-
if [ $# -lt 2 ]
5-
then
6-
echo "usage: bash create_upgrade_targz.sh {VERSION} {additional start-splice-cluster parameters}"
7-
echo "------------------------------------------------------------------------------------------"
8-
echo "uses a previously created tar.gz to test upgrade"
9-
echo "e.g. bash create_upgrade_targz.sh 3.2.2021 -T 16"
10-
echo "make sure you current branch has already been build"
11-
echo "don't use -b, since we are deleting some files in platform_it/target"
12-
13-
exit 1
14-
fi
5+
VERSION=${1} # e.g. 3.1.0.1971
6+
shift 1
7+
8+
PREVIOUS_BRANCH=`git rev-parse --abbrev-ref HEAD`
159

16-
VERSION=${1}
17-
shift
10+
# creates a file platform_it_${VERSION}.tar.gz
11+
git checkout tags/${VERSION}
12+
cd platform_it
13+
rm -rf target *.log snappy*.jnilib
14+
cd ..
1815

19-
# stop current cluster
16+
./start-splice-cluster $*
2017
./start-splice-cluster -k
2118

19+
rm -rf upgrade_test_TMP
20+
mkdir -p upgrade_test_TMP/platform_it/target
21+
cd upgrade_test_TMP
22+
cp -r ../platform_it/target/hbase platform_it/target/.
23+
cp -r ../platform_it/target/zookeeper platform_it/target/.
24+
tar -czvf ../platform_it_${VERSION}.tar.gz platform_it
25+
cd ..
26+
rm -rf upgrade_test_TMP
27+
28+
git checkout ${PREVIOUS_BRANCH}
29+
30+
31+
# restart on that version
32+
./start-splice-cluster $*
33+
2234
# clean up platform_it
2335
cd platform_it
2436
git clean -dfx
2537
cd ..
2638

2739
# download the previous standalone data
28-
aws s3 cp ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz .
2940
tar -xzvf platform_it_${VERSION}.tar.gz
3041
rm platform_it_${VERSION}.tar.gz
3142

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
UPGRADE_URL=s3://splice-snapshots/upgrade_tests
3+
4+
if [ $# -lt 2 ]
5+
then
6+
echo "usage: bash create_upgrade_targz.sh {VERSION} {additional start-splice-cluster parameters}"
7+
echo "------------------------------------------------------------------------------------------"
8+
echo "uses a previously created tar.gz to test upgrade"
9+
echo "e.g. bash create_upgrade_targz.sh 3.2.2021 -T 16"
10+
echo "make sure you current branch has already been build"
11+
echo "don't use -b, since we are deleting some files in platform_it/target"
12+
13+
exit 1
14+
fi
15+
16+
VERSION=${1}
17+
shift
18+
19+
# stop current cluster
20+
./start-splice-cluster -k
21+
22+
# clean up platform_it
23+
cd platform_it
24+
git clean -dfx
25+
cd ..
26+
27+
# download the previous standalone data
28+
aws s3 cp ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz .
29+
tar -xzvf platform_it_${VERSION}.tar.gz
30+
rm platform_it_${VERSION}.tar.gz
31+
32+
# restart cluster
33+
./start-splice-cluster -l $*
34+
35+
# test
36+
if mvn -B -e surefire:test -Pcore,cdh6.3.0 -Dtest='UpgradeTestIT#*' -DskipServerStart -DfailIfNoTests=false; then
37+
echo "UPGRADE SUCCEEDED"
38+
cat platform_it/splice.log | grep 'upgrade scripts'
39+
cat platform_it/splice.log | grep 'Running upgrade script'
40+
else
41+
echo "!!! UPGRADE FAILED !!!"
42+
fi

pipelines/upgrade-testing/create_upgrade_targz.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ rm -rf target *.log snappy*.jnilib
2727
cd ..
2828

2929
./start-splice-cluster $*
30+
./start-splice-cluster -k
3031

3132
rm -rf upgrade_test_TMP
3233
mkdir -p upgrade_test_TMP/platform_it/target

0 commit comments

Comments
 (0)