blob: 6107f60396de135ff22bb2bd81bc6a232dffc233 [file] [log] [blame]
Alexis de Talhouƫta6445582017-03-08 17:33:55 -05001#!/bin/bash
Michael Lando451a3402017-02-19 10:28:42 +02002
3cd /root/chef-solo
Michael Landoed64b5e2017-06-09 03:19:04 +03004mkdir -p /root/chef-solo/cookbooks/cassandra-actions/attributes
Michael Lando4d97d5f2017-06-17 22:40:44 +03005cl_rel=`basename /root/chef-solo/cookbooks/cassandra-actions/files/default/SDC* .zip|awk -F"-" '{print $2}'`
6echo "normal['version'] = \"${cl_rel}\"" > /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb
Michael Landoed64b5e2017-06-09 03:19:04 +03007echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb
8
Michael Lando451a3402017-02-19 10:28:42 +02009export CHEFNAME=${ENVNAME}
10
11sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb
12sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb
13sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb
14
15chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME}
16rc=$?
17
18if [[ $rc != 0 ]]; then exit $rc; fi
19echo "########### starting cassandra ###########"
20# start cassandra
21/docker-entrypoint.sh cassandra -f &
22
Michael Landoed64b5e2017-06-09 03:19:04 +030023sleep 10
24
Michael Lando451a3402017-02-19 10:28:42 +020025chef-solo -c solo.rb -E ${CHEFNAME}
26
Michael Lando451a3402017-02-19 10:28:42 +020027while true; do sleep 2; done
28