1919
2020VERSION ?= 2.0.0
2121
22+ RELEASE_SRC = apache-apisix-ingress-controller-${VERSION}-src
2223
2324IMAGE_TAG ?= dev
2425
@@ -31,14 +32,17 @@ GATEAY_API_VERSION ?= v1.2.0
3132DASHBOARD_VERSION ?= dev
3233ADC_VERSION ?= 0.20.0
3334
35+ GINKGO_VERSION ?= 2.20.0
3436TEST_TIMEOUT ?= 80m
3537TEST_DIR ?= ./test/e2e/
38+ E2E_NODES ?= 2
3639
3740# CRD Reference Documentation
3841CRD_REF_DOCS_VERSION ?= v0.1.0
3942CRD_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
4246
4347export KUBECONFIG = /tmp/$(KIND_NAME ) .kubeconfig
4448
@@ -137,6 +141,14 @@ download-api7ee3-chart:
137141 @helm pull api7/api7ee3 --destination " $( shell helm env HELM_REPOSITORY_CACHE) "
138142 @echo " Downloaded API7EE3 chart"
139143
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+
140152.PHONY : conformance-test
141153conformance-test :
142154 DASHBOARD_VERSION=$(DASHBOARD_VERSION ) go test -v ./test/conformance -tags=conformance -timeout 60m
@@ -170,15 +182,15 @@ kind-down:
170182
171183.PHONY : kind-load-images
172184kind-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 )
177189 @kind load docker-image jmalloc/echo-server:latest --name $(KIND_NAME )
178190
179191.PHONY : kind-load-gateway-image
180192kind-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 )
182194
183195.PHONY : kind-load-dashboard-images
184196kind-load-dashboard-images :
@@ -192,7 +204,7 @@ kind-load-ingress-image:
192204.PHONY : pull-infra-images
193205pull-infra-images :
194206 @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 )
196208 @docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION )
197209 @docker pull kennethreitz/httpbin:latest
198210 @docker pull jmalloc/echo-server:latest
@@ -389,7 +401,7 @@ generate-crd-docs: manifests ## Generate CRD reference documentation in a single
389401 --source-path=./api \
390402 --config=$(CRD_DOCS_CONFIG ) \
391403 --renderer=markdown \
392- --templates-dir=./docs/template \
404+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
393405 --output-path=$(CRD_DOCS_OUTPUT ) \
394406 --max-depth=100
395407 @echo " CRD reference documentation generated at $( CRD_DOCS_OUTPUT) "
@@ -402,7 +414,7 @@ generate-crd-docs-grouped: manifests ## Generate CRD reference documentation gro
402414 --source-path=./api \
403415 --config=$(CRD_DOCS_CONFIG ) \
404416 --renderer=markdown \
405- --templates-dir=./docs/template \
417+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
406418 --output-path=docs/crd/groups \
407419 --output-mode=group
408420 @echo " CRD reference documentation generated in docs/crd/groups directory"
@@ -416,3 +428,56 @@ verify-license:
416428.PHONY : update-license
417429update-license :
418430 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