Merge "Bump vagrant version to 2.2.0"
[multicloud/k8s.git] / deployments / build.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 set -o xtrace
14
15 k8s_path="$(git rev-parse --show-toplevel)"
16 export GOPATH=$k8s_path
17
18 echo "Compiling source code"
19 pushd $k8s_path/src/k8splugin/
20 make
21 popd
22
23 rm -f k8plugin *so
24 mv $k8s_path/src/k8splugin/k8plugin .
25 mv $k8s_path/src/k8splugin/plugins/*.so .
26
27 echo "Cleaning previous execution"
28 docker-compose kill
29 image=$(grep "image.*k8plugin" docker-compose.yml)
30 docker images ${image#*:} -q | xargs docker rmi -f
31 docker ps -a --filter "status=exited" -q | xargs docker rm
32
33 echo "Starting docker building process"
34 docker-compose build --no-cache