-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 1.25 KB
/
Makefile
File metadata and controls
65 lines (48 loc) · 1.25 KB
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
OC=oc
DEPLOYMENT_TARGETS= \
deploy/crds/postgresql_v1_postgresql_crd.yaml \
deploy/operator.yaml \
deploy/role_binding.yaml \
deploy/role.yaml \
deploy/service_account.yaml
OPERATOR_IMAGE=mcyprian/postgresql-operator
OPERATOR_VERSION=v0.0.1
.PHONY: all linters test build push up down test-e2e test-unit fmt imports ensure-imports lint
all: build push
linters: fmt vet ensure-imports lint
test: test-unit test-e2e
build:
@operator-sdk build $(OPERATOR_IMAGE):$(OPERATOR_VERSION)
push:
@docker push $(OPERATOR_IMAGE):$(OPERATOR_VERSION)
up:
@- $(foreach T,$(DEPLOYMENT_TARGETS), \
$(OC) apply -f $T ;\
)
down:
@- $(foreach T,$(DEPLOYMENT_TARGETS), \
$(OC) delete -f $T ;\
)
test-e2e:
@operator-sdk test local ./test/e2e --go-test-flags "-v -parallel=1 --timeout 20m"
test-unit:
@go test -v ./pkg/... ./cmd/...
fmt:
@gofmt -l -w cmd && \
gofmt -l -w pkg && \
gofmt -l -w test
vet:
@go vet ./...
lint:
@golint -set_exit_status pkg/k8shandler && \
golint -set_exit_status pkg/apis && \
golint -set_exit_status test/e2e
imports:
@goimports -w cmd pkg test
ensure-imports:
@if [ $$(goimports -l pkg test | wc -l) -ne 0 ]; \
then echo "Formatting of some files differs from goimport's"; false; \
fi
mod:
@go mod tidy && \
go mod verify