aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh')
-rw-r--r--openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh
new file mode 100644
index 0000000000..9e2c489cb0
--- /dev/null
+++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/startup.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+cd /root
+
+CS_PORT=""
+CS_HOST=127.0.0.1
+
+if [ ! -z "${CS_HOST_IP}" ]; then
+ CS_HOST=$CS_HOST_IP
+fi
+
+if [ ! -z "${CS_HOST_PORT}" ]; then
+ CS_PORT=$CS_HOST_PORT
+fi
+
+echo "[Info] Going to initialize sdc onboard cassandra: user=$SDC_USER; host=$CS_HOST; port=$CS_PORT"
+echo "[Info] Initializing onboard keyspaces"
+cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_keyspaces.cql $CS_HOST $CS_PORT
+
+echo "[Info] Initializing onboard schemas"
+cqlsh -u $SDC_USER -p $SDC_PASSWORD -f init_schemas.cql $CS_HOST $CS_PORT
+
+rc=$?
+if [[ $rc != 0 ]]; then exit $rc; fi \ No newline at end of file