2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018 Intel Corporation
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 source /etc/environment
16 k8s_path="$(git rev-parse --show-toplevel)"
17 export GOPATH=$k8s_path
20 echo "Starting mongo services"
22 docker-compose up -d mongo
23 export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=mongo"))
24 export no_proxy=${no_proxy:-},$DATABASE_IP
25 export NO_PROXY=${NO_PROXY:-},$DATABASE_IP
27 echo "Compiling source code"
28 pushd $k8s_path/src/k8splugin/
29 cat << EOF > k8sconfig.json
31 "database-address": "$DATABASE_IP",
32 "database-type": "mongo",
33 "plugin-dir": "$(pwd)/plugins",
34 "service-port": "9015",
35 "kube-config-dir": "$(pwd)/kubeconfigs"