-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
60 lines (50 loc) · 1.45 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
CGO_ENABLED?=0
GOOS?=linux
GO_BIN?=app
GO?=go
GOFLAGS?=-ldflags=-w -ldflags=-s -a -buildvcs
UI_FOLDER?=
MICROK8S_REGISTRY_FLAG?=SKAFFOLD_DEFAULT_REPO=localhost:32000
SKAFFOLD?=skaffold
CONFIGMAP?=deployments/kubectl/configMap.yaml
.EXPORT_ALL_VARIABLES:
mocks: vendor
$(GO) install go.uber.org/mock/mockgen@v0.3.0
# generate gomocks
$(GO) generate ./...
.PHONY: mocks
test: mocks vet
$(GO) test ./... -cover -coverprofile coverage_source.out
# this will be cached, just needed to the test.json
$(GO) test ./... -cover -coverprofile coverage_source.out -json > test_source.json
cat coverage_source.out | grep -v "mock_*" | tee coverage.out
cat test_source.json | grep -v "mock_*" | tee test.json
.PHONY: test
vet: cmd/ui/dist
$(GO) vet ./...
.PHONY: vet
vendor:
$(GO) mod vendor
.PHONY: vendor
build: cmd/ui/dist
$(GO) build -o $(GO_BIN) ./
.PHONY: build
# plan is to use this as a probe, if folder is there target wont run and npm-build will skip
# but not working atm
cmd/ui/dist:
@echo "copy dist npm files into cmd/ui folder"
mkdir -p cmd/ui/dist
cp -r $(UI_FOLDER)ui/dist cmd/ui/
.PHONY: cmd/ui/dist
npm-build:
$(MAKE) -C ui/ build
.PHONY: npm-build
dev:
@echo "after job admin-ui-openfga-setup has run, restart the identity-platform-admin-ui deployment"
@echo "to make sure the changes in the configmap are picked up"
@$(MICROK8S_REGISTRY_FLAG) $(SKAFFOLD) run \
--port-forward \
--no-prune=false \
--tail \
--cache-artifacts=false
.PHONY: dev