From 7dd6e2f9e3725427c628b214cb31bda1dbe95234 Mon Sep 17 00:00:00 2001 From: Shashank Kumar Shankar Date: Tue, 20 Mar 2018 16:48:05 -0700 Subject: Make datastore generic to support Consul/Cassandra This patch makes the backend datastore to be generic so that the backend datastore can be either Consul or Cassandra. This way, MUSIC's core functionality can be used and makes other minor fixes. Change-Id: Iba4eaa751fe60a293d6f2fd60ad06a8c4be1dd1e Issue-ID: MUSIC-55 Signed-off-by: Shashank Kumar Shankar --- deployment/docker-entrypoint.sh | 8 +++++--- deployment/run.sh | 6 ++++-- deployment/setup-dependency.sh | 7 ------- 3 files changed, 9 insertions(+), 12 deletions(-) delete mode 100755 deployment/setup-dependency.sh (limited to 'deployment') diff --git a/deployment/docker-entrypoint.sh b/deployment/docker-entrypoint.sh index 62cf23b..bc442b4 100755 --- a/deployment/docker-entrypoint.sh +++ b/deployment/docker-entrypoint.sh @@ -9,8 +9,10 @@ function start_api_server { ./dkv } -if [ "$CONSUL_IP" = "localhost" ]; then - start_consul_server - sleep 5 +if [ "$DATASTORE_IP" = "localhost" ]; then + if [ "$DATASTORE" = "consul" ]; then + start_consul_server + sleep 5 + fi fi start_api_server diff --git a/deployment/run.sh b/deployment/run.sh index 1be2ef2..996b70e 100755 --- a/deployment/run.sh +++ b/deployment/run.sh @@ -1,10 +1,12 @@ #!/bin/bash -CONSUL_IP="localhost" +DATASTORE="consul" +DATASTORE_IP="localhost" + MOUNTPATH="/dkv_mount_path/configs/" DEFAULT_CONFIGS=$(pwd)/../mountpath/default # TODO(sshank): Change this to think from Kubernetes Volumes perspective. -docker run -e CONSUL_IP=$CONSUL_IP -e MOUNTPATH=$MOUNTPATH -it \ +docker run -e DATASTORE=$DATASTORE -e DATASTORE_IP=$DATASTORE_IP -e MOUNTPATH=$MOUNTPATH -it \ --name dkv \ -v $DEFAULT_CONFIGS:/dkv_mount_path/configs/default \ -p 8200:8200 -p 8080:8080 nexus3.onap.org:10003/onap/music/distributed-kv-store diff --git a/deployment/setup-dependency.sh b/deployment/setup-dependency.sh deleted file mode 100755 index f1ca4c2..0000000 --- a/deployment/setup-dependency.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -function create_mountpath { - cp -r mountpath/ /configs -} - -create_mountpath -- cgit