-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
40 lines (26 loc) · 803 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
BINARY:=kustz
GOOS:=$(shell go env GOOS)
GOARCH:=$(shell go env GOARCH)
VERSION=v$(shell cat .version)
WORKSPACE ?= ./cmd/kustz
tidy:
go mod tidy
build:
go build -o out/$(BINARY)-$(VERSION)-$(GOOS)-$(GOARCH) $(WORKSPACE)
install:
go install $(WORKSPACE)
build.x:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(MAKE) build
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 $(MAKE) build
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(MAKE) build
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(MAKE) build
clean:
rm -rf out
test.deployment:
make test TARGET=Test_KustzDeployment
test.kustomize:
make test TARGET=Test_KustzKustomize
test:
go test -timeout 30s -run ^$(TARGET) github.com/tangx/kustz/pkg/kustz -v -count=1
version:
git add . && git commit -m 'chore: release $(VERSION)' && git tag $(VERSION)