19
19
20
20
VERSION ?= 2.0.0
21
21
22
+ RELEASE_SRC = apache-apisix-ingress-controller-${VERSION}-src
22
23
23
24
IMAGE_TAG ?= dev
24
25
@@ -31,14 +32,17 @@ GATEAY_API_VERSION ?= v1.2.0
31
32
DASHBOARD_VERSION ?= dev
32
33
ADC_VERSION ?= 0.20.0
33
34
35
+ GINKGO_VERSION ?= 2.20.0
34
36
TEST_TIMEOUT ?= 80m
35
37
TEST_DIR ?= ./test/e2e/
38
+ E2E_NODES ?= 2
36
39
37
40
# CRD Reference Documentation
38
41
CRD_REF_DOCS_VERSION ?= v0.1.0
39
42
CRD_REF_DOCS ?= $(LOCALBIN ) /crd-ref-docs
40
- CRD_DOCS_CONFIG ?= docs/crd/config.yaml
41
- CRD_DOCS_OUTPUT ?= docs/crd/api.md
43
+ CRD_DOCS_CONFIG ?= docs/assets/crd/config.yaml
44
+ CRD_DOCS_OUTPUT ?= docs/en/latest/api-reference.md
45
+ CRD_DOCS_TEMPLATE ?= docs/assets/template
42
46
43
47
export KUBECONFIG = /tmp/$(KIND_NAME ) .kubeconfig
44
48
@@ -137,6 +141,14 @@ download-api7ee3-chart:
137
141
@helm pull api7/api7ee3 --destination " $( shell helm env HELM_REPOSITORY_CACHE) "
138
142
@echo " Downloaded API7EE3 chart"
139
143
144
+ .PHONY : ginkgo-e2e-test
145
+ ginkgo-e2e-test :
146
+ @ginkgo -cover -coverprofile=coverage.txt -r --randomize-all --randomize-suites --trace --focus=$(E2E_FOCUS ) --nodes=$(E2E_NODES ) $(TEST_DIR )
147
+
148
+ .PHONY : install-ginkgo
149
+ install-ginkgo :
150
+ @go install github.com/onsi/ginkgo/v2/ginkgo@v$(GINKGO_VERSION )
151
+
140
152
.PHONY : conformance-test
141
153
conformance-test :
142
154
DASHBOARD_VERSION=$(DASHBOARD_VERSION ) go test -v ./test/conformance -tags=conformance -timeout 60m
@@ -170,15 +182,15 @@ kind-down:
170
182
171
183
.PHONY : kind-load-images
172
184
kind-load-images : pull-infra-images kind-load-ingress-image
173
- @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
174
- @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
175
- @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
176
- @kind load docker-image kennethreitz/httpbin:latest --name $(KIND_NAME )
185
+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
186
+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
187
+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
188
+ @kind load docker-image kennethreitz/httpbin:latest --name $(KIND_NAME )
177
189
@kind load docker-image jmalloc/echo-server:latest --name $(KIND_NAME )
178
190
179
191
.PHONY : kind-load-gateway-image
180
192
kind-load-gateway-image :
181
- @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
193
+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
182
194
183
195
.PHONY : kind-load-dashboard-images
184
196
kind-load-dashboard-images :
@@ -192,7 +204,7 @@ kind-load-ingress-image:
192
204
.PHONY : pull-infra-images
193
205
pull-infra-images :
194
206
@docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev
195
- @docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION )
207
+ @docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION )
196
208
@docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION )
197
209
@docker pull kennethreitz/httpbin:latest
198
210
@docker pull jmalloc/echo-server:latest
@@ -389,7 +401,7 @@ generate-crd-docs: manifests ## Generate CRD reference documentation in a single
389
401
--source-path=./api \
390
402
--config=$(CRD_DOCS_CONFIG ) \
391
403
--renderer=markdown \
392
- --templates-dir=./docs/template \
404
+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
393
405
--output-path=$(CRD_DOCS_OUTPUT ) \
394
406
--max-depth=100
395
407
@echo " CRD reference documentation generated at $( CRD_DOCS_OUTPUT) "
@@ -402,7 +414,7 @@ generate-crd-docs-grouped: manifests ## Generate CRD reference documentation gro
402
414
--source-path=./api \
403
415
--config=$(CRD_DOCS_CONFIG ) \
404
416
--renderer=markdown \
405
- --templates-dir=./docs/template \
417
+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
406
418
--output-path=docs/crd/groups \
407
419
--output-mode=group
408
420
@echo " CRD reference documentation generated in docs/crd/groups directory"
@@ -416,3 +428,56 @@ verify-license:
416
428
.PHONY : update-license
417
429
update-license :
418
430
docker run -it --rm -v $(PWD ) :/github/workspace apache/skywalking-eyes header fix
431
+
432
+ # ## verify-mdlint: Verify markdown files lint rules.
433
+ .PHONY : verify-mdlint
434
+ verify-mdlint :
435
+ docker run -it --rm -v $(PWD ) :/work tmknom/markdownlint ' **/*.md' --ignore node_modules --ignore CHANGELOG.md
436
+
437
+ # ## update-mdlint: Update markdown files lint rules.
438
+ .PHONY : update-mdlint
439
+ update-mdlint :
440
+ docker run -it --rm -v $(PWD ) :/work tmknom/markdownlint ' **/*.md' -f --ignore node_modules --ignore vendor --ignore CHANGELOG.md
441
+
442
+ # ## verify-yamllint: Verify yaml files lint rules for `examples` directory.
443
+ .PHONY : verify-yamllint
444
+ verify-yamllint :
445
+ docker run -it --rm -v $(PWD ) :/yaml peterdavehello/yamllint yamllint examples
446
+
447
+ # ## update-yamlfmt: Update yaml files format for `examples` directory.
448
+ .PHONY : update-yamlfmt
449
+ update-yamlfmt :
450
+ go install github.com/google/yamlfmt/cmd/yamlfmt@latest && yamlfmt examples
451
+
452
+ # ## verify-all: Verify all verify- rules.
453
+ .PHONY : verify-all
454
+ verify-all : verify-license verify-mdlint verify-yamllint
455
+
456
+ # ## update-all: Update all update- rules.
457
+ .PHONY : update-all
458
+ update-all : update-license update-mdlint update-gofmt
459
+
460
+ # ## release-src: Release source
461
+ release-src :
462
+ tar -zcvf $(RELEASE_SRC ) .tgz \
463
+ --exclude .github \
464
+ --exclude .git \
465
+ --exclude .idea \
466
+ --exclude .gitignore \
467
+ --exclude .DS_Store \
468
+ --exclude docs \
469
+ --exclude examples \
470
+ --exclude scripts \
471
+ --exclude samples \
472
+ --exclude test \
473
+ --exclude release \
474
+ --exclude $(RELEASE_SRC ) .tgz \
475
+ .
476
+
477
+ gpg --batch --yes --armor --detach-sig $(RELEASE_SRC).tgz
478
+ shasum -a 512 $(RELEASE_SRC).tgz > $(RELEASE_SRC).tgz.sha512
479
+
480
+ mkdir -p release
481
+ mv $(RELEASE_SRC).tgz release/$(RELEASE_SRC).tgz
482
+ mv $(RELEASE_SRC).tgz.asc release/$(RELEASE_SRC).tgz.asc
483
+ mv $(RELEASE_SRC).tgz.sha512 release/$(RELEASE_SRC).tgz.sha512
0 commit comments