aboutsummaryrefslogtreecommitdiffstats
path: root/distribution/cassandra_job/runcql.sh
diff options
context:
space:
mode:
authorThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-09-17 22:35:25 -0400
committerThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-09-17 22:35:25 -0400
commita9efc16e26cd57d69bb2dc691cec01ec842930cc (patch)
tree8ed97ecbfdb7c3e94d5e3aad5dff8d812dbefbc7 /distribution/cassandra_job/runcql.sh
parentbdeb60322c8a4477f19c616f5f1a6a1058c72204 (diff)
Update distribution files to support helm charts
Helm Charts require new Docker images. Refined Cassandra and Cassandra cql loader. Change-Id: Ie7726025afd63e256a43aef9f39d53c32c90c77b Issue-ID: MUSIC-99 Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
Diffstat (limited to 'distribution/cassandra_job/runcql.sh')
-rw-r--r--distribution/cassandra_job/runcql.sh31
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
+