DATACASS-307 - Run TravisCI build against various Cassandra versions.
We now run TravisCI builds against various Cassandra versions.
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -13,3 +13,6 @@ build
|
||||
.settings
|
||||
.cassandra
|
||||
.idea
|
||||
download
|
||||
work
|
||||
|
||||
|
||||
14
.travis.yml
14
.travis.yml
@@ -7,10 +7,22 @@ env:
|
||||
- PROFILE=spring41-next
|
||||
- PROFILE=spring42
|
||||
- PROFILE=spring42-next
|
||||
- PROFILE=spring43
|
||||
- PROFILE=spring43-next
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=2.2.6
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.0.7
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.2
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.3
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.4
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.5
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.6
|
||||
- PROFILE=external-cassandra CASSANDRA_VERSION=3.7
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- 'download'
|
||||
sudo: false
|
||||
install: true
|
||||
before_install:
|
||||
- sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml
|
||||
install: if [ ! -z ${CASSANDRA_VERSION} ]; then ./setup-cassandra.sh; fi;
|
||||
script: mvn clean install -P${PROFILE} -Dmaven.javadoc.skip=true
|
||||
|
||||
67
setup-cassandra.sh
Executable file
67
setup-cassandra.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z ${CASSANDRA_VERSION+x} ]; then
|
||||
CASSANDRA_VERSION=3.0.7
|
||||
fi
|
||||
|
||||
if [[ ! -d download ]] ; then
|
||||
mkdir -p download
|
||||
fi
|
||||
|
||||
FILENAME="apache-cassandra-${CASSANDRA_VERSION}-bin.tar.gz"
|
||||
|
||||
echo "[INFO] Downloading ${FILENAME}"
|
||||
if [[ ! -f download/${FILENAME} ]] ; then
|
||||
mkdir -p download
|
||||
wget https://archive.apache.org/dist/cassandra/${CASSANDRA_VERSION}/${FILENAME} -O download/${FILENAME}
|
||||
if [[ $? != 0 ]] ; then
|
||||
echo "[ERROR] Download failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -d work ]] ; then
|
||||
mkdir -p work
|
||||
fi
|
||||
|
||||
BASENAME=apache-cassandra-${CASSANDRA_VERSION}
|
||||
if [[ ! -d work/${BASENAME} ]] ; then
|
||||
|
||||
echo "[INFO] Extracting ${FILENAME}"
|
||||
mkdir -p work/${BASENAME}
|
||||
cd work
|
||||
|
||||
tar xzf ../download/${FILENAME}
|
||||
if [[ $? != 0 ]] ; then
|
||||
echo "[ERROR] Extraction failed"
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
fi
|
||||
|
||||
cd work/${BASENAME}
|
||||
|
||||
echo "[INFO] Cleaning data directory"
|
||||
rm -Rf data
|
||||
mkdir -p data
|
||||
|
||||
echo "[INFO] Starting Apache Cassandra ${CASSANDRA_VERSION}"
|
||||
export MAX_HEAP_SIZE=1G
|
||||
export HEAP_NEWSIZE=100M
|
||||
bin/cassandra
|
||||
|
||||
for start in {1..20}
|
||||
do
|
||||
nc -w 1 localhost 9042 </dev/null
|
||||
if [[ $? == 0 ]] ; then
|
||||
echo "[INFO] Cassandra is up and running"
|
||||
cd ../..
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "[ERROR] Cannot connect to Cassandra"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user