-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (46 loc) · 1.18 KB
/
Makefile
File metadata and controls
63 lines (46 loc) · 1.18 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
VERSION:=v0.0.$(shell date +%Y%m%d)
IMAGENAME:=ctrreschk
REGISTRY?=quay.io/fromani
BUILDID?=01
TAG?=$(VERSION)$(BUILDID)
IMAGE:=$(REGISTRY)/$(IMAGENAME):$(TAG)
.PHONY: all
all: build
.PHONY: build
build: binaries
image:
@podman build -t $(IMAGE) .
binaries: ctrreschk
outdir:
@mkdir -p _out
ctrreschk: outdir
CGO_ENABLED=0 go build -v -o _out/ctrreschk cmd/ctrreschk/main.go
test-unit:
@go test -coverprofile=coverage.out ./pkg/...
cover-summary:
go tool cover -func=coverage.out
cover-view:
go tool cover -html=coverage.out
.PHONY: vet
vet:
go vet ./...
##@ CI
CLUSTER_NAME?=ctrreschk-ci
IMAGE_CI?=dev.kind.local/ci/ctrreschk:latest
.PHONY: ci-build-image
ci-build-image:
docker build -t $(IMAGE_CI) -f Containerfile .
.PHONY: ci-kind-setup
ci-kind-setup: ci-build-image
kind create cluster --name $(CLUSTER_NAME) --config hack/ci/kind-ci.yaml
kind load docker-image --name $(CLUSTER_NAME) $(IMAGE_CI)
kubectl wait --for=condition=Ready nodes --all --timeout=120s
.PHONY: ci-kind-teardown
ci-kind-teardown:
kind delete cluster --name $(CLUSTER_NAME)
.PHONY: test-e2e
test-e2e:
CTRRESCHK_E2E_IMAGE=$(IMAGE_CI) go test -v -count=1 ./test/e2e/...
.PHONY: clean
clean:
@rm -rf _out