-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DB-11134 start-splice-cluster to abort when start fails, added pipeli…
…nes/upgrade-testing - check_upgrade.sh {VERSION} {additional start-splice-cluster parameters}" - create_upgrade_targz.sh {VERSION} {test/upload} {additional start-splice-cluster parameters}
- Loading branch information
1 parent
04cc8a6
commit 82a64dc
Showing
4 changed files
with
117 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
UPGRADE_URL=s3://splice-snapshots/upgrade_tests | ||
|
||
if [ $# -lt 2 ] | ||
then | ||
echo "usage: bash create_upgrade_targz.sh {VERSION} {additional start-splice-cluster parameters}" | ||
echo "------------------------------------------------------------------------------------------" | ||
echo "uses a previously created tar.gz to test upgrade" | ||
echo "e.g. bash create_upgrade_targz.sh 3.2.2021 -T 16" | ||
echo "make sure you current branch has already been build" | ||
echo "don't use -b, since we are deleting some files in platform_it/target" | ||
|
||
exit 1 | ||
fi | ||
|
||
VERSION=${1} | ||
shift | ||
|
||
# stop current cluster | ||
./start-splice-cluster -k | ||
|
||
# clean up platform_it | ||
cd platform_it | ||
git clean -dfx | ||
cd .. | ||
|
||
# download the previous standalone data | ||
aws s3 cp ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz . | ||
tar -xzvf platform_it_${VERSION}.tar.gz | ||
rm platform_it_${VERSION}.tar.gz | ||
|
||
# restart cluster | ||
./start-splice-cluster -l $* | ||
|
||
# test | ||
if mvn -B -e surefire:test -Pcore,cdh6.3.0 -Dtest='UpgradeTestIT#*' -DskipServerStart -DfailIfNoTests=false; then | ||
echo "UPGRADE SUCCEEDED" | ||
cat platform_it/splice.log | grep 'upgrade scripts' | ||
cat platform_it/splice.log | grep 'Running upgrade script' | ||
else | ||
echo "!!! UPGRADE FAILED !!!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
UPGRADE_URL=s3://splice-snapshots/upgrade_tests | ||
|
||
|
||
if [ $# -lt 2 ] | ||
then | ||
echo "usage: bash platform_it/src/test/bin/create_upgrade_targz.sh {VERSION} {test/upload} {additional start-splice-cluster parameters}" | ||
echo "----------------------------------------------------------------------------------------------------------------------------------" | ||
echo "creates a tar.gz of a spliceengine standalone cluster that can be used to test upgrade" | ||
echo "e.g. bash create_upgrade_targz.sh 3.1.0.1971 test -T 16 -pcore,cdh6.3.0" | ||
exit 1 | ||
fi | ||
|
||
VERSION=${1} # e.g. 3.1.0.1971 | ||
MODE=${2} # test or upload | ||
shift 2 | ||
|
||
|
||
PREVIOUS_BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
git stash | ||
|
||
# creates a file platform_it_${VERSION}.tar.gz | ||
git checkout tags/${VERSION} | ||
cd platform_it | ||
rm -rf target *.log snappy*.jnilib | ||
cd .. | ||
|
||
./start-splice-cluster $* | ||
|
||
rm -rf upgrade_test_TMP | ||
mkdir -p upgrade_test_TMP/platform_it/target | ||
cd upgrade_test_TMP | ||
cp -r ../platform_it/target/hbase platform_it/target/. | ||
cp -r ../platform_it/target/zookeeper platform_it/target/. | ||
tar -czvf ../platform_it_${VERSION}.tar.gz platform_it | ||
cd .. | ||
rm -rf upgrade_test_TMP | ||
|
||
if [[ $MODE == "upload" ]]; then | ||
aws s3 cp platform_it_${VERSION}.tar.gz ${UPGRADE_URL}/platform_it_${VERSION}.tar.gz | ||
fi | ||
|
||
git checkout ${PREVIOUS_BRANCH} | ||
git stash pop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters