Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (49 loc) · 2.4 KB
/
Copy pathMakefile
File metadata and controls
67 lines (49 loc) · 2.4 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
66
67
TAG = $$(git rev-parse --short HEAD)
IMG_NAME ?= ghcr.io/spegel-org/spegel
IMG_REF = $(IMG_NAME):$(TAG)
WEBHOOK_IMG_NAME ?= ghcr.io/spegel-org/spegel-webhook
WEBHOOK_IMG_REF = $(WEBHOOK_IMG_NAME):$(TAG)
.PHONY: generate
generate: charts/spegel/README.md charts/spegel-stack/README.md
charts/spegel/README.md: charts/spegel/values.yaml charts/spegel/README.md.gotmpl
@cd ./charts/spegel && go tool helm-docs
charts/spegel-stack/README.md: charts/spegel-stack/values.yaml charts/spegel-stack/README.md.gotmpl
@cd ./charts/spegel-stack && go tool helm-docs
.PHONY: lint lint-root lint-webhook
lint: lint-root lint-webhook
lint-root:
@golangci-lint run ./...
lint-webhook:
@cd webhook && golangci-lint run ./...
.PHONY: build
build:
@GOOS=linux goreleaser build --snapshot --clean --single-target --skip before --id spegel
.PHONY: build-image
build-image: build
@docker buildx build -t ${IMG_REF} .
@echo ${IMG_REF}
.PHONY: build-webhook
build-webhook:
@GOOS=linux goreleaser build --snapshot --clean --single-target --skip before --id spegel-webhook
.PHONY: build-image-webhook
build-image-webhook: build-webhook
@docker buildx build -t ${WEBHOOK_IMG_REF} -f Dockerfile.webhook .
@echo ${WEBHOOK_IMG_REF}
.PHONY: test-unit test-unit-root test-unit-webhook
test-unit: test-unit-root test-unit-webhook
test-unit-root:
@go test ./... -race
test-unit-webhook:
@cd webhook && go test ./... -race
.PHONY: test-integration-containerd
test-integration-containerd:
@cd ./test/integration/containerd && INTEGRATION_TEST_STRATEGY="fast" go test -v -timeout 200s -count 1 ./...
.PHONY: test-integration-kubernetes
test-integration-kubernetes: build-image
@cd ./test/integration/kubernetes && INTEGRATION_TEST_STRATEGY="fast" IMG_REF=${IMG_REF} go test -v -timeout 300s -count 1 ./...
.PHONY: test-e2e-webhook-core
test-e2e-webhook-core: build-image build-image-webhook
@cd ./test/integration/kubernetes && INTEGRATION_TEST_STRATEGY="fast" IMG_REF=${IMG_REF} WEBHOOK_IMG_REF=${WEBHOOK_IMG_REF} go test -run '^(TestKubernetesWebhookCore|TestKubernetesWebhookEnforce|TestKubernetesWebhookPreProvisionedTLS)$$' -v -timeout 1800s -count 1 ./...
.PHONY: test-e2e-webhook-extended
test-e2e-webhook-extended: build-image build-image-webhook
@cd ./test/integration/kubernetes && INTEGRATION_TEST_STRATEGY="fast" IMG_REF=${IMG_REF} WEBHOOK_IMG_REF=${WEBHOOK_IMG_REF} go test -run '^TestKubernetesWebhookExtended$$' -v -timeout 2700s -count 1 ./...