aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-09-04 15:58:56 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-04 15:58:56 +0000
commit6e2857125fdce17a1541f3ca45ee0b988e9ef4de (patch)
treea8ee559dd73c9c330894ffe807ea13c98e575dbe /src/k8splugin
parent28376cbc428324577451181f67f383ea9d8de164 (diff)
parentb3eb398fef49293156658e6f9e09a78eaca45c51 (diff)
Merge "Update building process"
Diffstat (limited to 'src/k8splugin')
-rw-r--r--src/k8splugin/Makefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile
index 586eca9c..3aa8223f 100644
--- a/src/k8splugin/Makefile
+++ b/src/k8splugin/Makefile
@@ -16,11 +16,20 @@ export GOPATH ...
.PHONY: plugins
-build: clean dep plugins tests
-deploy: clean dep plugins build_binary tests
-build_binary:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w' -o ./k8plugin ./cmd/main.go
+all: clean dep
+ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -tags netgo -o ./deployment.so ./plugins/deployment/plugin.go
+ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -tags netgo -o ./namespace.so ./plugins/namespace/plugin.go
+ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -tags netgo -o ./service.so ./plugins/service/plugin.go
+
+ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o ./k8plugin ./cmd/main.go
+
+# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence
+# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with
+# mock plugin errors out for unit tests. So the seperation avoids the error.
+
+build: clean dep plugins tests
+deploy: build
tests:
go test -v ./... -cover