Alexis de Talhouƫt | a644558 | 2017-03-08 17:33:55 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 2 | |
| 3 | cd /root/chef-solo |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 4 | mkdir -p /root/chef-solo/cookbooks/cassandra-actions/attributes |
Michael Lando | 4d97d5f | 2017-06-17 22:40:44 +0300 | [diff] [blame] | 5 | cl_rel=`basename /root/chef-solo/cookbooks/cassandra-actions/files/default/SDC* .zip|awk -F"-" '{print $2}'` |
| 6 | echo "normal['version'] = \"${cl_rel}\"" > /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 7 | echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb |
| 8 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 9 | export CHEFNAME=${ENVNAME} |
| 10 | |
| 11 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb |
| 12 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb |
| 13 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb |
| 14 | |
| 15 | chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME} |
| 16 | rc=$? |
| 17 | |
| 18 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 19 | echo "########### starting cassandra ###########" |
| 20 | # start cassandra |
| 21 | /docker-entrypoint.sh cassandra -f & |
| 22 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 23 | sleep 10 |
| 24 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 25 | chef-solo -c solo.rb -E ${CHEFNAME} |
| 26 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 27 | while true; do sleep 2; done |
| 28 | |