Merge "Bump virtlet to 1.4.3 and criproxy to 0.14.0"
[multicloud/k8s.git] / deployments / start.sh
1 #!/bin/bash
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 ##############################################################################
10
11 set -o nounset
12 set -o pipefail
13
14 source /etc/environment
15
16 k8s_path="$(git rev-parse --show-toplevel)"
17 export GOPATH=$k8s_path
18 export IMAGE_NAME="nexus3.onap.org:10003/onap/multicloud/k8s"
19
20 export CSAR_DIR=/opt/csar
21 export KUBE_CONFIG_DIR=/opt/kubeconfig
22 export DATABASE_TYPE=mongo
23 export PLUGINS_DIR=$k8s_path/src/k8splugin/plugins
24
25 echo "Starting mongo services"
26 docker-compose kill
27 docker-compose up -d mongo
28 export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=mongo"))
29 export no_proxy=$no_proxy,$DATABASE_IP
30 export NO_PROXY=$NO_PROXY,$DATABASE_IP
31
32 echo "Compiling source code"
33 pushd $k8s_path/src/k8splugin/
34 make plugins
35 env GO111MODULE=on go run cmd/main.go
36 popd