1919
2020VERSION ?= 2.0.0
2121
22+ RELEASE_SRC = apache-apisix-ingress-controller-${VERSION}-src
2223
2324IMAGE_TAG ?= dev
2425
@@ -31,16 +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
42-
43- export KUBECONFIG = /tmp/$(KIND_NAME ) .kubeconfig
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
4446
4547# go
4648VERSYM ="github.com/apache/apisix-ingress-controller/internal/version._buildVersion"
@@ -137,6 +139,14 @@ download-api7ee3-chart:
137139 @helm pull api7/api7ee3 --destination " $( shell helm env HELM_REPOSITORY_CACHE) "
138140 @echo " Downloaded API7EE3 chart"
139141
142+ .PHONY : ginkgo-e2e-test
143+ ginkgo-e2e-test :
144+ @ginkgo -cover -coverprofile=coverage.txt -r --randomize-all --randomize-suites --trace --focus=$(E2E_FOCUS ) --nodes=$(E2E_NODES ) $(TEST_DIR )
145+
146+ .PHONY : install-ginkgo
147+ install-ginkgo :
148+ @go install github.com/onsi/ginkgo/v2/ginkgo@v$(GINKGO_VERSION )
149+
140150.PHONY : conformance-test
141151conformance-test :
142152 DASHBOARD_VERSION=$(DASHBOARD_VERSION ) go test -v ./test/conformance -tags=conformance -timeout 60m
@@ -170,15 +180,15 @@ kind-down:
170180
171181.PHONY : kind-load-images
172182kind-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 )
183+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
184+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
185+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION ) --name $(KIND_NAME )
186+ @kind load docker-image kennethreitz/httpbin:latest --name $(KIND_NAME )
177187 @kind load docker-image jmalloc/echo-server:latest --name $(KIND_NAME )
178188
179189.PHONY : kind-load-gateway-image
180190kind-load-gateway-image :
181- @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
191+ @kind load docker-image hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-gateway:dev --name $(KIND_NAME )
182192
183193.PHONY : kind-load-dashboard-images
184194kind-load-dashboard-images :
@@ -192,7 +202,7 @@ kind-load-ingress-image:
192202.PHONY : pull-infra-images
193203pull-infra-images :
194204 @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 )
205+ @docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-dp-manager:$(DASHBOARD_VERSION )
196206 @docker pull hkccr.ccs.tencentyun.com/api7-dev/api7-ee-3-integrated:$(DASHBOARD_VERSION )
197207 @docker pull kennethreitz/httpbin:latest
198208 @docker pull jmalloc/echo-server:latest
@@ -389,7 +399,7 @@ generate-crd-docs: manifests ## Generate CRD reference documentation in a single
389399 --source-path=./api \
390400 --config=$(CRD_DOCS_CONFIG ) \
391401 --renderer=markdown \
392- --templates-dir=./docs/template \
402+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
393403 --output-path=$(CRD_DOCS_OUTPUT ) \
394404 --max-depth=100
395405 @echo " CRD reference documentation generated at $( CRD_DOCS_OUTPUT) "
@@ -402,7 +412,7 @@ generate-crd-docs-grouped: manifests ## Generate CRD reference documentation gro
402412 --source-path=./api \
403413 --config=$(CRD_DOCS_CONFIG ) \
404414 --renderer=markdown \
405- --templates-dir=./docs/template \
415+ --templates-dir=$( CRD_DOCS_TEMPLATE ) \
406416 --output-path=docs/crd/groups \
407417 --output-mode=group
408418 @echo " CRD reference documentation generated in docs/crd/groups directory"
@@ -416,3 +426,56 @@ verify-license:
416426.PHONY : update-license
417427update-license :
418428 docker run -it --rm -v $(PWD ) :/github/workspace apache/skywalking-eyes header fix
429+
430+ # ## verify-mdlint: Verify markdown files lint rules.
431+ .PHONY : verify-mdlint
432+ verify-mdlint :
433+ docker run -it --rm -v $(PWD ) :/work tmknom/markdownlint ' **/*.md' --ignore node_modules --ignore CHANGELOG.md
434+
435+ # ## update-mdlint: Update markdown files lint rules.
436+ .PHONY : update-mdlint
437+ update-mdlint :
438+ docker run -it --rm -v $(PWD ) :/work tmknom/markdownlint ' **/*.md' -f --ignore node_modules --ignore vendor --ignore CHANGELOG.md
439+
440+ # ## verify-yamllint: Verify yaml files lint rules for `examples` directory.
441+ .PHONY : verify-yamllint
442+ verify-yamllint :
443+ docker run -it --rm -v $(PWD ) :/yaml peterdavehello/yamllint yamllint examples
444+
445+ # ## update-yamlfmt: Update yaml files format for `examples` directory.
446+ .PHONY : update-yamlfmt
447+ update-yamlfmt :
448+ go install github.com/google/yamlfmt/cmd/yamlfmt@latest && yamlfmt examples
449+
450+ # ## verify-all: Verify all verify- rules.
451+ .PHONY : verify-all
452+ verify-all : verify-license verify-mdlint verify-yamllint
453+
454+ # ## update-all: Update all update- rules.
455+ .PHONY : update-all
456+ update-all : update-license update-mdlint update-gofmt
457+
458+ # ## release-src: Release source
459+ release-src :
460+ tar -zcvf $(RELEASE_SRC ) .tgz \
461+ --exclude .github \
462+ --exclude .git \
463+ --exclude .idea \
464+ --exclude .gitignore \
465+ --exclude .DS_Store \
466+ --exclude docs \
467+ --exclude examples \
468+ --exclude scripts \
469+ --exclude samples \
470+ --exclude test \
471+ --exclude release \
472+ --exclude $(RELEASE_SRC ) .tgz \
473+ .
474+
475+ gpg --batch --yes --armor --detach-sig $(RELEASE_SRC).tgz
476+ shasum -a 512 $(RELEASE_SRC).tgz > $(RELEASE_SRC).tgz.sha512
477+
478+ mkdir -p release
479+ mv $(RELEASE_SRC).tgz release/$(RELEASE_SRC).tgz
480+ mv $(RELEASE_SRC).tgz.asc release/$(RELEASE_SRC).tgz.asc
481+ mv $(RELEASE_SRC).tgz.sha512 release/$(RELEASE_SRC).tgz.sha512
0 commit comments