summaryrefslogtreecommitdiffstats
path: root/services/activity-spec/activity-spec-init
diff options
context:
space:
mode:
Diffstat (limited to 'services/activity-spec/activity-spec-init')
-rw-r--r--services/activity-spec/activity-spec-init/Dockerfile2
-rw-r--r--services/activity-spec/activity-spec-init/start.sh16
2 files changed, 13 insertions, 5 deletions
diff --git a/services/activity-spec/activity-spec-init/Dockerfile b/services/activity-spec/activity-spec-init/Dockerfile
index 09361461dd..a940b20c5f 100644
--- a/services/activity-spec/activity-spec-init/Dockerfile
+++ b/services/activity-spec/activity-spec-init/Dockerfile
@@ -2,8 +2,6 @@ FROM alpine:3.7
RUN apk add --no-cache 'python<3' py-pip && pip install cqlsh==4.0.1
-ENV CASSANDRA_PORT=9160
-
COPY create_activityspec_db.cql .
COPY start.sh .
diff --git a/services/activity-spec/activity-spec-init/start.sh b/services/activity-spec/activity-spec-init/start.sh
index defc8efedf..582f0bde0a 100644
--- a/services/activity-spec/activity-spec-init/start.sh
+++ b/services/activity-spec/activity-spec-init/start.sh
@@ -1,8 +1,18 @@
#!/bin/sh
-if [[ -z "${CASSANDRA_HOST}" ]]; then
- echo "CASSANDRA_HOST environment variable must be set"
+if [[ -z "${CS_USER}" ]]; then
+ echo "CS_USER environment variable must be set"
exit 1
fi
-cqlsh -f /create_activityspec_db.cql $CASSANDRA_HOST $CASSANDRA_PORT \ No newline at end of file
+if [[ -z "${CS_PASSWORD}" ]]; then
+ echo "CS_PASSWORD environment variable must be set"
+ exit 1
+fi
+
+if [[ -z "${CS_HOST}" ]]; then
+ echo "CS_HOST environment variable must be set"
+ exit 1
+fi
+
+cqlsh -u $CS_USER -p $CS_PASSWORD -f /create_activityspec_db.cql $CS_HOST $CS_PORT