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