Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Add a Travis build using Riak 2.0 with legacy search enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Feb 16, 2015
1 parent 7744985 commit d25d14c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ python:
node_js:
- "0.10"
env:
- VUMITEST_REDIS_DB=1 VUMIGO_TEST_DB=postgres VUMI_TEST_TIMEOUT=10
- VUMITEST_REDIS_DB=1 VUMIGO_TEST_DB=postgres VUMI_TEST_TIMEOUT=10 RIAK_VERSION=current
matrix:
include:
# Test against the Travis-provided version of Riak (currently 2.0.x).
# This is a separate matrix inclusion to avoid spawning unnecessary builds.
- python: "2.7"
env: VUMITEST_REDIS_DB=1 VUMIGO_TEST_DB=postgres VUMI_TEST_TIMEOUT=10 RIAK_VERSION="1.4.12-1"
services:
- postgresql
- redis-server
before_install:
# We need Riak 1.4, so we add Basho's repo and install from there.
# Additionally, we remove existing Riak data and replace the config with ours.
- sudo service riak stop
- "curl http://apt.basho.com/gpg/basho.apt.key | sudo apt-key add -"
- sudo bash -c "echo deb http://apt.basho.com $(lsb_release -sc) main > /etc/apt/sources.list.d/basho.list"
- sudo apt-get -qq update
- sudo apt-get install -qq -y --force-yes riak=1.4.12-1
- sudo rm -rf /var/lib/riak/*
- sudo cp utils/app.config /etc/riak/app.config
- sudo service riak start
# Set up an appropriate version of Riak.
- sudo utils/setup_travis_riak.sh "${RIAK_VERSION}"
# We need the protobuf-compiler so we can install Riak client libraries.
- sudo apt-get -qq update
- sudo apt-get install -qq protobuf-compiler
install:
- "pip install -r requirements.pip --use-wheel"
Expand All @@ -35,7 +34,7 @@ before_script:
- "pip list"
# To see what version of Riak we're running and check that it's happy.
- riak version
- riak-admin member-status
- sudo riak-admin member-status
script:
- ./run-tests.sh
- grunt test
Expand Down
8 changes: 8 additions & 0 deletions utils/advanced.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{riak_search, [ {enabled, true} ]},
{merge_index, [
{data_root, "/var/lib/riak/merge_index"},
{buffer_rollover_size, 1048576},
{max_compact_segments, 20}
]}
].
45 changes: 45 additions & 0 deletions utils/setup_travis_riak.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# NOTE: This needs to be run as root.

RIAK_VERSION="${1?Please provide Riak version.}"

echo "Setting up Riak with RIAK_VERSION='${RIAK_VERSION}'"

# Stop Riak (if it's running) so we can change stuff underneath it.
service riak stop


function install_riak() {
# We're installing our own Riak version, so we add Basho's repo.
curl http://apt.basho.com/gpg/basho.apt.key | apt-key add -
bash -c "echo deb http://apt.basho.com $(lsb_release -sc) main > /etc/apt/sources.list.d/basho.list"
apt-get -qq update
apt-get install -qq -y --force-yes riak="${RIAK_VERSION}"
}


case "${RIAK_VERSION}" in
current)
# We want to use the existing Riak (2.0.something at time of writing).
# We need to copy over our own advanced config to enable legacy search.
echo "Using installed Riak with v2.0 extra config for legacy search..."
cp utils/advanced.config /etc/riak/advanced.config
;;
1.4.*)
# We want Riak 1.4.x, so install it and copy over a suitable config.
echo "Installing Riak ${RIAK_VERSION} with v1.4 config..."
install_riak
cp utils/app.config /etc/riak/app.config
;;
*)
# Unexpected version.
echo "I don't know how to set up Riak ${RIAK_VERSION}, sorry."
exit 1
;;
esac


# Get rid of all the existing Riak data so we start fresh and then start fresh.
rm -rf /var/lib/riak/*
service riak start

0 comments on commit d25d14c

Please sign in to comment.