summaryrefslogtreecommitdiff
path: root/devfiles/scripts/bootstrap-cassandra.sh
blob: 128767e333af0618c1dca762c7adebc3c822051b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

##
## This script deletes all Cassandra data and creates and populates the
## ColumnFamilies needed to start the Growth Process.
##

export TOOLS=`awk -F= '/jesterpm\.buildtools\.root/ { print $2 }' $HOME/.jesterpm-build-tools.properties`
export DEVFILES=$(dirname $0)/..

$TOOLS/scripts/setup-cassandra.sh

# Bootstrap keyspace
TEMPFILE=`mktemp`
cat $DEVFILES/scripts/cassandra-bootstrap.cql > $TEMPFILE

# Fill with questions
$DEVFILES/scripts/compile-questions.sh >> $TEMPFILE

# Fill with videos
$DEVFILES/scripts/compile-videos.sh >> $TEMPFILE

# GO!
#cat $TEMPFILE | less
cassandra-cli < $TEMPFILE
rm $TEMPFILE