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 |
| 5 | echo "normal['version'] = \"${RELEASE}\"" > /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb |
| 6 | echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb |
| 7 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 8 | export CHEFNAME=${ENVNAME} |
| 9 | |
| 10 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb |
| 11 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb |
| 12 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb |
| 13 | |
| 14 | chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME} |
| 15 | rc=$? |
| 16 | |
| 17 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 18 | echo "########### starting cassandra ###########" |
| 19 | # start cassandra |
| 20 | /docker-entrypoint.sh cassandra -f & |
| 21 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 22 | sleep 10 |
| 23 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 24 | chef-solo -c solo.rb -E ${CHEFNAME} |
| 25 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 26 | while true; do sleep 2; done |
| 27 | |