summaryrefslogtreecommitdiffstats
path: root/deployments/build.sh
diff options
context:
space:
mode:
authorShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2018-08-31 15:06:02 -0700
committerVictor Morales <victor.morales@intel.com>2018-08-31 09:33:25 -0700
commitb3eb398fef49293156658e6f9e09a78eaca45c51 (patch)
treef99084cab892c5ba8251e759c5a61f4d4f17b44b /deployments/build.sh
parent2f0b896a56c6297ce3434c8d5279b3440e437f18 (diff)
Update building process
The building process differed from the build.sh script and Makefile. In other words, the docker images were created with different instructions than development process. This patch centralizes these instructions in a single source for building binaries. Change-Id: Ib214d335b0e696be6a1a09d3cb8126a75bdf2da4 Issue-ID: MULTICLOUD-301 Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> Signed-off-by: Victor Morales <victor.morales@intel.com>
Diffstat (limited to 'deployments/build.sh')
-rwxr-xr-xdeployments/build.sh33
1 files changed, 14 insertions, 19 deletions
diff --git a/deployments/build.sh b/deployments/build.sh
index 7c2d7379..a88ebbc7 100755
--- a/deployments/build.sh
+++ b/deployments/build.sh
@@ -10,25 +10,20 @@
set -o nounset
set -o pipefail
-set -o xtrace
-function generate_binary {
- export GOPATH="$(pwd)/../"
- rm -f k8plugin
- rm -f *.so
- pushd ../src/k8splugin/
- dep ensure -v
- popd
- for plugin in deployment namespace service; do
- CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -tags netgo -o ./$plugin.so ../src/k8splugin/plugins/$plugin/plugin.go
- done
- CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o ./k8plugin ../src/k8splugin/cmd/main.go
-}
+k8s_path="$(git rev-parse --show-toplevel)"
-function build_image {
- echo "Start build docker image."
- docker-compose build --no-cache
-}
+echo "Compiling source code"
+pushd $k8s_path/src/k8splugin/
+make
+popd
-generate_binary
-build_image
+pushd $k8s_path/deployments
+for file in k8plugin *so; do
+ rm -f $file
+ mv $k8s_path/src/k8splugin/$file .
+done
+
+echo "Starting docker building process"
+docker-compose build --no-cache
+popd