From cf79276e2b633211d9a0befcb0e978dea447a9cf Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Fri, 4 Sep 2020 14:44:45 +0200 Subject: Provide capability to specify release-name during instantiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow release-name property to be provided during instantiation that, if provided, overrides release-name specified in profile. Additionally updated Makefile to allow easy compilation with different go version easily. Issue-ID: MULTICLOUD-1175 Signed-off-by: Konrad Bańka Change-Id: Id8db484369045cfb0bc99543a80317644fc838f9 --- src/k8splugin/Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/k8splugin/Makefile') diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile index 77196afa..a1cda8dd 100644 --- a/src/k8splugin/Makefile +++ b/src/k8splugin/Makefile @@ -8,13 +8,14 @@ ############################################################################## export GO111MODULE=on +GO ?= go .PHONY: plugins all: clean plugins CGO_ENABLED=1 GOOS=linux GOARCH=amd64 - @go build -tags netgo -o ./k8plugin ./cmd/main.go + @$(GO) build -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 @@ -25,14 +26,14 @@ deploy: build .PHONY: test test: clean - @go build -race -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go - @go test -race ./... + @$(GO) build -race -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go + @$(GO) test -race ./... format: - @go fmt ./... + @$(GO) fmt ./... plugins: - @find plugins -maxdepth 1 -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs go build -buildmode=plugin -tags netgo -o $(basename {}).so" \; + @find plugins -maxdepth 1 -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs $(GO) build -buildmode=plugin -tags netgo -o $(basename {}).so" \; clean: @find . -name "*so" -delete @@ -40,5 +41,5 @@ clean: .PHONY: cover cover: - @go test -race ./... -coverprofile=coverage.out - @go tool cover -html=coverage.out -o coverage.html + @$(GO) test -race ./... -coverprofile=coverage.out + @$(GO) tool cover -html=coverage.out -o coverage.html -- cgit 1.2.3-korg