summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-cass')
-rw-r--r--auth/auth-cass/cass_init/cmd.sh4
-rw-r--r--auth/auth-cass/cass_init/push.sh5
-rw-r--r--auth/auth-cass/cass_init/restore.sh2
-rw-r--r--auth/auth-cass/docker/Dockerfile.cass11
4 files changed, 13 insertions, 9 deletions
diff --git a/auth/auth-cass/cass_init/cmd.sh b/auth/auth-cass/cass_init/cmd.sh
index f605a472..bfd592a3 100644
--- a/auth/auth-cass/cass_init/cmd.sh
+++ b/auth/auth-cass/cass_init/cmd.sh
@@ -24,7 +24,7 @@
DIR="/opt/app/aaf/status"
INSTALLED_VERSION=/var/lib/cassandra/AAF_VERSION
AAF_INIT_DATA=/var/lib/cassandra/AAF_INIT_DATA
-CQLSH=${CQLSH:=/opt/cassandra/bin/cqlsh}
+CQLSH=${CQLSH:=/usr/bin/cqlsh}
if [ ! -e /aaf_cmd ]; then
ln -s /opt/app/aaf/cass_init/cmd.sh /aaf_cmd
@@ -137,7 +137,7 @@ function install_onap {
bash prep.sh
status push data to cassandra
# bash push.sh
- echo "YES" | bash restore.sh
+ bash push.sh
cd -
echo $(date) > $AAF_INIT_DATA
fi
diff --git a/auth/auth-cass/cass_init/push.sh b/auth/auth-cass/cass_init/push.sh
index f887f077..a6f8277d 100644
--- a/auth/auth-cass/cass_init/push.sh
+++ b/auth/auth-cass/cass_init/push.sh
@@ -22,6 +22,9 @@
# These are obtained from "gzipped" files, or pre-placed (i.e. initialization)
# in the "dats" directory
#
+
+CQLSH="${CQLSH:=/usr/bin/cqlsh} -k authz"
+
DIR=/opt/app/aaf/cass_init
cd $DIR
if [ ! -e dats ]; then
@@ -35,7 +38,7 @@ fi
cd dats
for T in $(ls *.dat); do
if [ -s $T ]; then
- cqlsh --request-timeout=100 -e "COPY authz.${T/.dat/} FROM '$T' WITH DELIMITER='|';";
+ $CQLSH --request-timeout=100 -e "COPY authz.${T/.dat/} FROM '$T' WITH DELIMITER='|';";
fi
done
cd $DIR
diff --git a/auth/auth-cass/cass_init/restore.sh b/auth/auth-cass/cass_init/restore.sh
index ba2c49eb..0bf0ea65 100644
--- a/auth/auth-cass/cass_init/restore.sh
+++ b/auth/auth-cass/cass_init/restore.sh
@@ -4,7 +4,7 @@
echo `date`
ENV=DOCKER
-CQLSH="${CQLSH:=/opt/cassandra/bin/cqlsh} -k authz"
+CQLSH="${CQLSH:=/usr/bin/cqlsh} -k authz"
cd dats
if [ "$*" = "" ]; then
diff --git a/auth/auth-cass/docker/Dockerfile.cass b/auth/auth-cass/docker/Dockerfile.cass
index 5d9c3db9..2d60da2e 100644
--- a/auth/auth-cass/docker/Dockerfile.cass
+++ b/auth/auth-cass/docker/Dockerfile.cass
@@ -34,11 +34,12 @@ COPY sample.identities.dat /opt/app/aaf/cass_init/data/identites.dat
RUN mkdir -p /opt/app/aaf/status &&\
chmod 777 /opt/app/aaf/status && \
- addgroup ${DUSER} && adduser --ingroup cassandra --disabled-password --gecos "" --shell /bin/bash ${DUSER} && \
- chown -R ${DUSER}:cassandra /opt/app/aaf/cass_init &&\
- chown -R ${DUSER}:cassandra /etc/cassandra &&\
- mkdir -p /var/lib/cassandra/data && chown -R ${DUSER}:cassandra /var/lib/cassandra &&\
- chown -R ${DUSER}:cassandra /var/log/cassandra &&\
+ if [ ! -z "${DUSER}" ]; then \
+ addgroup --gid 1000 ${DUSER}; \
+ adduser --ingroup ${DUSER} --disabled-password --gecos "" --shell /bin/bash -u 1000 ${DUSER} ; \
+ mkdir -p /var/lib/cassandra/data /var/log/cassandra ; \
+ chown -R 1000:1000 /opt/app/aaf /etc/cassandra /var/log/cassandra /var/lib/cassandra ; \
+ fi && \
ln -s /opt/app/aaf/cass_init/cmd.sh /aaf_cmd && chmod a+x /aaf_cmd
USER ${DUSER}