1 if ["`docker ps -a | grep aaf_cass`" == ""]; then
2 docker run --name aaf_cass -d cassandra:3.11
3 echo "Check for running Docker Container aaf_cass, then run again."
6 docker exec aaf_cass mkdir -p /opt/app/cass_init
7 docker cp "../src/main/cql/." aaf_cass:/opt/app/cass_init
11 echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
12 echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
14 echo " cd /opt/app/cass_init"
15 echo " cqlsh -u root -p root -f keyspace.cql"
16 echo " cqlsh -u root -p root -f init.cql"
17 echo " cqlsh -u root -p root -f osaaf.cql"
19 echo "The following will give you a temporary identity with which to start working, or emergency"
20 echo " cqlsh -u root -p root -f temp_identity.cql"
21 echo "Sleeping for 10 seconds"
23 docker exec -it aaf_cass bash -c '\
24 cd /opt/app/cass_init; \
25 echo "Creating Keyspace";cqlsh -u root -p root -f keyspace.cql;\
26 echo "Creating init";cqlsh -u root -p root -f init.cql;\
27 echo "Creating osaaf";cqlsh -u root -p root -f osaaf.cql;\
28 echo "Creating temp Identity";cqlsh -u root -p root -f temp_identity.cql'
30 echo "Inspecting aafcassadra. Use to get the IP address to update org.osaaf.cassandra.props"
31 docker inspect aaf_cass | grep '"IPAddress' | head -1