diff options
author | Bharath Balasubramanian <bharathb@research.att.com> | 2018-09-18 02:48:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-09-18 02:48:41 +0000 |
commit | 1c28ca5b696c1c8df24c207fd1235af0b85c4186 (patch) | |
tree | 2ea4dc577eabbf91eb91fdf673d75de06cdfd049 /distribution/cassandra_job/runcql.sh | |
parent | 82c874161df1bc657ed309938cbdd24d6a3294bd (diff) | |
parent | a9efc16e26cd57d69bb2dc691cec01ec842930cc (diff) |
Merge "Update distribution files to support helm charts"
Diffstat (limited to 'distribution/cassandra_job/runcql.sh')
-rw-r--r-- | distribution/cassandra_job/runcql.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/distribution/cassandra_job/runcql.sh b/distribution/cassandra_job/runcql.sh new file mode 100644 index 00000000..e1fb31fc --- /dev/null +++ b/distribution/cassandra_job/runcql.sh @@ -0,0 +1,31 @@ +#! /bin/bash +if [ $CASS_HOSTNAME ]; then + echo "#############################################" + echo "############## Let run cql's ################" + echo "#############################################" + echo "admin.cql file:" + cat /cql/admin.cql + echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}" + sleep 1; + if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi + echo "admin_pw.cql file:" + cat /cql/admin_pw.cql + echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}" + sleep 1; + if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi + + for f in /cql/extra/*; do + case "$f" in + *.cql) + echo "$0: running $f" && cqlsh -u ${USERNAME} -p ${PASSWORD} -f "$f" ${CASS_HOSTNAME} ${PORT}; + ;; + *) + echo "$0: ignoring $f" + ;; + esac + done +else + echo "Missing CASS_HOSTNAME"; + exit 1; +fi + |