forked from vmware-tanzu/kubeapps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (49 loc) · 2.17 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
IMPORT_PATH:= github.com/kubeapps/kubeapps
GO = /usr/bin/env go
GOFMT = /usr/bin/env gofmt
VERSION ?= dev-$(shell date +%FT%H-%M-%S-%Z)
BINARY ?= kubeapps
GO_PACKAGES = ./...
GO_FILES := $(shell find $(shell $(GO) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_FLAGS = -ldflags="-s -w -X github.com/kubeapps/kubeapps/cmd/kubeapps.VERSION=${VERSION}"
EMBEDDED_STATIC = generated/statik/statik.go
default: kubeapps
all: kubeapps kubeapps/dashboard kubeapps/chartsvc kubeapps/chart-repo kubeapps/apprepository-controller
static/kubeapps-objs.yaml:
KUBEAPPS_VERSION=$${VERSION:-latest} ;\
KUBECFG_JPATH=./manifests/lib:./manifests/vendor/kubecfg/lib:./manifests/vendor/ksonnet-lib \
kubecfg show -V VERSION=$$KUBEAPPS_VERSION manifests/kubeapps.jsonnet > static/kubeapps-objs.yaml
$(EMBEDDED_STATIC): static/kubeapps-objs.yaml
# force compilation on current OS
GOOS= $(GO) build -o statik ./vendor/github.com/rakyll/statik/statik.go
$(GO) generate
# Deprecated, will be removed in future releases
kubeapps: $(EMBEDDED_STATIC)
$(GO) build -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)
# TODO(miguel) Create Makefiles per component
kubeapps/%:
docker build -t kubeapps/$*:$(VERSION) -f cmd/$*/Dockerfile .
kubeapps/dashboard:
docker build -t kubeapps/dashboard:$(VERSION) -f dashboard/Dockerfile dashboard/
kubeapps/tiller-proxy:
CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o ./cmd/tiller-proxy/proxy-static ./cmd/tiller-proxy
docker build -t kubeapps/tiller-proxy:$(VERSION) -f cmd/tiller-proxy/Dockerfile cmd/tiller-proxy
test: $(EMBEDDED_STATIC)
$(GO) test $(GO_PACKAGES)
test-all: test-kubeapps test-chartsvc test-chart-repo test-apprepository-controller test-dashboard
# Deprecated
test-kubeapps:
$(GO) test -v $(IMPORT_PATH)
test-dashboard:
yarn --cwd dashboard/ install --frozen-lockfile
yarn --cwd=dashboard run lint
CI=true yarn --cwd dashboard/ run test
test-%:
$(GO) test -v $(IMPORT_PATH)/cmd/$*
fmt:
$(GOFMT) -s -w $(GO_FILES)
vet:
$(GO) vet $(GO_PACKAGES)
clean:
$(RM) ./kubeapps ./statik $(EMBEDDED_STATIC) static/kubeapps-objs.yaml
.PHONY: default all test-all test test-dashboard fmt vet clean build-prep chart-repo kubeapps $(EMBEDDED_STATIC) static/kubeapps-objs.yaml