Add Certs, Docker Build
[aaf/authz.git] / auth / auth-cass / docker / dinstall
1 #!/bin/bash dinstall
2 if ["`docker ps -a | grep aaf_cass`" == ""]; then
3   docker run --name aaf_cass  -d cassandra:3.11
4 else 
5   docker exec aaf_cass mkdir -p /opt/app/cass_init
6   docker cp "../src/main/cql/." aaf_cass:/opt/app/cass_init
7 fi
8
9 echo "Docker Installed Basic Cassandra on aaf_cass.  Executing the following "
10 echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
11 echo ""
12 echo " cd /opt/app/cass_init"  
13 echo " cqlsh -u root -p root -f keyspace.cql"
14 echo " cqlsh -u root -p root -f init.cql"
15 echo " cqlsh -u root -p root -f osaaf.cql"
16 echo ""
17 echo "The following will give you a temporary identity with which to start working, or emergency"
18 echo " cqlsh -u root -p root -f temp_identity.cql"
19 echo "Sleeping 10 seconds to allow Cassandra to start"
20 sleep 10
21 docker exec -it aaf_cass bash -c '\
22 cd /opt/app/cass_init; \
23 echo "Creating Keyspace";cqlsh -u root -p root -f keyspace.cql;\
24 echo "Creating init";cqlsh -u root -p root -f init.cql;\
25 echo "Creating osaaf";cqlsh -u root -p root -f osaaf.cql;\
26 echo "Creating temp Identity";cqlsh -u root -p root -f temp_identity.cql'
27
28 echo "Inspecting aafcassadra.  Use to get the IP address to update org.osaaf.cassandra.props"
29 docker inspect aaf_cass | grep '"IPAddress' | head -1