Merge "Add context into for sink service selector"
[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
19 export CSAR_DIR=/opt/csar
20 export KUBE_CONFIG_DIR=/opt/kubeconfig
21 export DATABASE_TYPE=consul
22 export PLUGINS_DIR=$k8s_path/src/k8splugin/plugins
23
24 echo "Starting consul services"
25 docker-compose kill
26 docker-compose up -d consul
27 export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' deployments_consul_1)
28 export no_proxy=$no_proxy,$DATABASE_IP
29 export NO_PROXY=$NO_PROXY,$DATABASE_IP
30
31 echo "Compiling source code"
32 pushd $k8s_path/src/k8splugin/
33 make plugins
34 env GO111MODULE=on go run cmd/main.go
35 popd