Base makefile and root makefile target for functions/examples

This commit is contained in:
Katrina Verey
2022-04-05 14:37:18 -04:00
parent c071cdaedd
commit 03c94eabb7
8 changed files with 65 additions and 207 deletions

View File

@@ -1,40 +1,9 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0
.PHONY: generate fix vet fmt test build tidy image
export KUSTOMIZE_ROOT ?= $(shell pwd | sed -E 's|(.*\/kustomize)/(.*)|\1|')
include $(KUSTOMIZE_ROOT)/Makefile-tools.mk
build:
(cd image && go build -v -o $(GOBIN)/config-function .)
all: generate build fix vet fmt test lint tidy
fix:
(cd image && go fix ./...)
fmt:
(cd image && go fmt ./...)
generate: $(MYGOBIN)/mdtogo
(cd image && GOBIN=$(MYGOBIN) go generate ./...)
tidy:
(cd image && go mod tidy)
lint: $(MYGOBIN)/golangci-lint
(cd image && $(MYGOBIN)/golangci-lint \
-c $$KUSTOMIZE_ROOT/.golangci.yml \
--path-prefix $(shell pwd | sed -E 's|(.*\/kustomize)/(.*)|\2|') \
run ./...)
test:
(cd image && go test -cover ./...)
vet:
(cd image && go vet ./...)
include ../Makefile-examples-base.mk
.PHONY: image
image:
docker build image -t gcr.io/kustomize-functions/create-application:v0.1.0
docker push gcr.io/kustomize-functions/create-application:v0.1.0