#!/bin/bash

if [ $DATABASE == "rethinkdb" ]; then
    cd ../..
    git checkout bench_baseline
    LOCAL_GIT_ROOT=`pwd`
    mkdir -p /tmp/baseline-git
    cd /tmp/baseline-git
    git clone "$LOCAL_GIT_ROOT"
    cd rethinkdb
    #git checkout bench_baseline
    
    cd src
    make clean
    make -j DEBUG=0 VALGRIND=0 FAST_PERFMON=1
    cd ../bench/stress-client
    #make
    # Use baseline stress client for this test. We must recover the original version after the test!
    #ssh puzzler mv -f /home/teapot/stress /home/teapot/stress-head
    #scp stress puzzler:/home/teapot/stress
    cd ../dbench
    
    ../../build/release/rethinkdb create $SSD_DRIVES --force
fi
