aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-09-06 08:11:19 -0700
committerVictor Morales <victor.morales@intel.com>2018-09-06 08:11:19 -0700
commit5b6f0c4efbfdc0c9bcb440c8da132bdaee4e518d (patch)
treee539318c16635fd0577714a96f2b34a194393040 /src/k8splugin
parentf1421fca0034e77bf213dbcc4b96ee655cc29936 (diff)
Improve compilation process
The current architecture offers the possibility to add more plugins and extend the its functionality. This flexibility has to be supported during the compilation process. This change modify the Makefile to find plugins and compile them. It also adds a start.sh script which allows to run MultiCloud services without the need of packaging their binaries in a container. Change-Id: I9271c51daa4fd9156717e37f1818886c72e36c27 Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
Diffstat (limited to 'src/k8splugin')
-rw-r--r--src/k8splugin/Makefile11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile
index 542de958..6171d8c2 100644
--- a/src/k8splugin/Makefile
+++ b/src/k8splugin/Makefile
@@ -16,10 +16,9 @@ export GOPATH ...
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
+ CGO_ENABLED=1 GOOS=linux GOARCH=amd64
+ @find plugins -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs go build -buildmode=plugin -a -tags netgo -o $(basename {}).so" \;
+ 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
@@ -36,9 +35,7 @@ format:
go fmt ./...
plugins:
- go build -buildmode=plugin -o ./plugins/deployment/deployment.so ./plugins/deployment/plugin.go
- go build -buildmode=plugin -o ./plugins/namespace/namespace.so ./plugins/namespace/plugin.go
- go build -buildmode=plugin -o ./plugins/service/service.so ./plugins/service/plugin.go
+ @find plugins -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs go build -buildmode=plugin -o $(basename {}).so" \;
dep:
go get -u $(DEPENDENCIES)