diff options
Diffstat (limited to 'deployments')
-rwxr-xr-x | deployments/build.sh | 4 | ||||
-rw-r--r-- | deployments/docker-compose.yml | 15 | ||||
-rwxr-xr-x | deployments/start.sh | 8 |
3 files changed, 12 insertions, 15 deletions
diff --git a/deployments/build.sh b/deployments/build.sh index 90da6f95..c6d4a244 100755 --- a/deployments/build.sh +++ b/deployments/build.sh @@ -35,7 +35,9 @@ function _cleanup { echo "Cleaning previous execution" docker-compose kill image=$(grep "image.*k8plugin" docker-compose.yml) - docker images ${image#*:} -q | xargs docker rmi -f + if [[ -n ${image} ]]; then + docker images ${image#*:} -q | xargs docker rmi -f + fi docker ps -a --filter "status=exited" -q | xargs docker rm } diff --git a/deployments/docker-compose.yml b/deployments/docker-compose.yml index 73d5651c..a72bd096 100644 --- a/deployments/docker-compose.yml +++ b/deployments/docker-compose.yml @@ -28,33 +28,28 @@ services: environment: - CSAR_DIR=/opt/csar - KUBE_CONFIG_DIR=/opt/kubeconfig - - DATABASE_TYPE=consul + - DATABASE_TYPE=mongo - DATABASE_IP=172.19.0.2 - PLUGINS_DIR=/opt/multicloud/k8s - HTTP_PROXY=$HTTP_PROXY - HTTPS_PROXY=$HTTPS_PROXY - NO_PROXY=$NO_PROXY,172.19.0.2 depends_on: - - consul + - mongo links: - - consul + - mongo volumes: - /opt/csar:/opt/csar - /opt/kubeconfig:/opt/kubeconfig - consul: - image: consul + mongo: + image: mongo networks: multicloud_net: ipv4_address: 172.19.0.2 environment: - CONSUL_CLIENT_INTERFACE: 'eth0' - CONSUL_BIND_INTERFACE: 'eth0' HTTP_PROXY: $HTTP_PROXY HTTPS_PROXY: $HTTPS_PROXY NO_PROXY: $NO_PROXY - command: ["agent", "-server", "-bootstrap-expect=1"] - volumes: - - /opt/consul/config:/consul/config networks: multicloud_net: diff --git a/deployments/start.sh b/deployments/start.sh index da2eacee..d1b9f68a 100755 --- a/deployments/start.sh +++ b/deployments/start.sh @@ -19,13 +19,13 @@ export IMAGE_NAME="nexus3.onap.org:10003/onap/multicloud/k8s" export CSAR_DIR=/opt/csar export KUBE_CONFIG_DIR=/opt/kubeconfig -export DATABASE_TYPE=consul +export DATABASE_TYPE=mongo export PLUGINS_DIR=$k8s_path/src/k8splugin/plugins -echo "Starting consul services" +echo "Starting mongo services" docker-compose kill -docker-compose up -d consul -export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=consul")) +docker-compose up -d mongo +export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=mongo")) export no_proxy=$no_proxy,$DATABASE_IP export NO_PROXY=$NO_PROXY,$DATABASE_IP |