summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/docker
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-cass/docker')
-rw-r--r--auth/auth-cass/docker/Dockerfile.cass4
-rw-r--r--auth/auth-cass/docker/backup.sh13
-rw-r--r--auth/auth-cass/docker/dbash.sh11
-rw-r--r--auth/auth-cass/docker/dbuild.sh10
-rw-r--r--auth/auth-cass/docker/dcqlsh.sh9
-rw-r--r--auth/auth-cass/docker/dinstall.sh2
-rw-r--r--auth/auth-cass/docker/drun.sh18
7 files changed, 38 insertions, 29 deletions
diff --git a/auth/auth-cass/docker/Dockerfile.cass b/auth/auth-cass/docker/Dockerfile.cass
index d4487f9d..16028eae 100644
--- a/auth/auth-cass/docker/Dockerfile.cass
+++ b/auth/auth-cass/docker/Dockerfile.cass
@@ -7,9 +7,7 @@ LABEL version=${AAF_VERSION}
COPY cass_init/*.cql /opt/app/aaf/cass_init/
COPY cass_init/*.sh /opt/app/aaf/cass_init/
-COPY cass_init/*.dat /opt/app/aaf/cass_init/
-COPY cass_data /opt/app/aaf/cass_init/dats/
-COPY sample.identities.dat /opt/app/aaf/cass_init/
+COPY cass_data/*.dat /opt/app/aaf/cass_init/dats/
ENTRYPOINT ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh"]
CMD ["start"]
diff --git a/auth/auth-cass/docker/backup.sh b/auth/auth-cass/docker/backup.sh
index 78a5e64d..b533c3ef 100644
--- a/auth/auth-cass/docker/backup.sh
+++ b/auth/auth-cass/docker/backup.sh
@@ -1,4 +1,11 @@
-#mkdir -p $DIR
-docker container exec -it aaf_cass bash -e '/opt/app/aaf/cass_init/pull.sh'
-docker container cp aaf_cass:/opt/app/aaf/cass_init/dat.gz "dat$(date +%Y%m%d).gz"
+#!/bin/bash
+
+# Pull in AAF Env Variables from AAF install
+if [ -e ../../docker/d.props ]; then
+ . ../../docker/d.props
+fi
+DOCKER=${DOCKER:-docker}
+
+$DOCKER container exec -it aaf_cass bash -e '/opt/app/aaf/cass_init/pull.sh'
+$DOCKER container cp aaf_cass:/opt/app/aaf/cass_init/dat.gz "dat$(date +%Y%m%d).gz"
diff --git a/auth/auth-cass/docker/dbash.sh b/auth/auth-cass/docker/dbash.sh
index 38e43dd0..b352a35c 100644
--- a/auth/auth-cass/docker/dbash.sh
+++ b/auth/auth-cass/docker/dbash.sh
@@ -1,3 +1,10 @@
-#!/bin/bash
-docker exec -it aaf_cass bash
+#!/bin/bash
+
+# Pull in AAF Env Variables from AAF install
+if [ -e ../../docker/d.props ]; then
+ . ../../docker/d.props
+fi
+DOCKER=${DOCKER:-docker}
+
+$DOCKER exec -it aaf_cass bash
diff --git a/auth/auth-cass/docker/dbuild.sh b/auth/auth-cass/docker/dbuild.sh
index aeef3293..f483557c 100644
--- a/auth/auth-cass/docker/dbuild.sh
+++ b/auth/auth-cass/docker/dbuild.sh
@@ -5,9 +5,8 @@
# Pull in AAF Env Variables from AAF install
if [ -e ../../docker/d.props ]; then
. ../../docker/d.props
-else
- . ../../docker/d.props.init
fi
+DOCKER=${DOCKER:-docker}
echo "Building aaf_cass Container for aaf_cass:$VERSION"
@@ -18,9 +17,10 @@ cd ..
cp -Rf sample/cass_data auth-cass/cass_data
cp sample/data/sample.identities.dat auth-cass
-docker build -t ${ORG}/${PROJECT}/aaf_cass:${VERSION} auth-cass
-docker tag ${ORG}/${PROJECT}/aaf_cass:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_cass:${VERSION}
-docker tag ${ORG}/${PROJECT}/aaf_cass:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_cass:latest
+echo $DOCKER build -t ${ORG}/${PROJECT}/aaf_cass:${VERSION} auth-cass
+$DOCKER build -t ${ORG}/${PROJECT}/aaf_cass:${VERSION} auth-cass
+$DOCKER tag ${ORG}/${PROJECT}/aaf_cass:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_cass:${VERSION}
+$DOCKER tag ${ORG}/${PROJECT}/aaf_cass:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_cass:latest
cd -
rm Dockerfile
diff --git a/auth/auth-cass/docker/dcqlsh.sh b/auth/auth-cass/docker/dcqlsh.sh
index a6c08643..ce861dc2 100644
--- a/auth/auth-cass/docker/dcqlsh.sh
+++ b/auth/auth-cass/docker/dcqlsh.sh
@@ -1,3 +1,8 @@
-#!/bin/bash
-docker exec -it aaf_cass /usr/bin/cqlsh -k authz
+#!/bin/bash
+
+# Pull in AAF Env Variables from AAF install
+if [ -e ../../docker/d.props ]; then
+ . ../../docker/d.props
+fi
+${DOCKER:=docker} exec -it aaf_cass /usr/bin/cqlsh -k authz
diff --git a/auth/auth-cass/docker/dinstall.sh b/auth/auth-cass/docker/dinstall.sh
index ec82d8af..11bf6a15 100644
--- a/auth/auth-cass/docker/dinstall.sh
+++ b/auth/auth-cass/docker/dinstall.sh
@@ -6,7 +6,7 @@
echo "Waiting for Cass to be initialized"
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
- docker exec -it aaf_cass bash aaf_cmd wait 2> /dev/null
+ $DOCKER exec -it aaf_cass bash aaf_cmd wait 2> /dev/null
if [ "$?" -ne "0" ]; then
echo "Container not ready... Sleep 10"
sleep 10
diff --git a/auth/auth-cass/docker/drun.sh b/auth/auth-cass/docker/drun.sh
index 081411b3..21de1ac4 100644
--- a/auth/auth-cass/docker/drun.sh
+++ b/auth/auth-cass/docker/drun.sh
@@ -1,26 +1,18 @@
-#!/bin/bash
+#!/bin/bash
# Pull in AAF Env Variables from AAF install
if [ -e ../../docker/d.props ]; then
. ../../docker/d.props
-else
- . ../../docker/d.props.init
-fi
-
-if [ -e /usr/bin/docker ]; then
- DOCKER=/usr/bin/docker
-elif [ -e /usr/local/bin/docker ]; then
- DOCKER=/usr/local/bin/docker
-else
- echo Docker not available in /usr/bin or /usr/local/bin
- exit
fi
+DOCKER=${DOCKER:-docker}
if [ "$($DOCKER volume ls | grep aaf_cass_data)" = "" ]; then
$DOCKER volume create aaf_cass_data
echo "Created Cassandra Volume aaf_cass_data"
fi
+# Optional mount instead of v
+# --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \
if [ "`$DOCKER ps -a | grep aaf_cass`" == "" ]; then
echo "starting Cass from 'run'"
# NOTE: These HEAP Sizes are minimal. Not set for full organizations.
@@ -30,7 +22,7 @@ if [ "`$DOCKER ps -a | grep aaf_cass`" == "" ]; then
-e MAX_HEAP_SIZE=1024M \
-e CASSANDRA_DC=dc1 \
-e CASSANDRA_CLUSTER_NAME=osaaf \
- --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \
+ -v "aaf_cass_data:/var/lib/cassandra" \
-d ${PREFIX}${ORG}/${PROJECT}/aaf_cass:${VERSION} "onap"
else
$DOCKER start aaf_cass