Skip to content

Commit

Permalink
chore: load EXTRA_TAGS from plugin .buildrc file to avoid build issue. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Colstuwjx authored Mar 5, 2025
1 parent 0905cd0 commit d721c23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/wasm-go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ COMMIT_ID := $(shell git rev-parse --short HEAD 2>/dev/null)
IMAGE_TAG = $(if $(strip $(PLUGIN_VERSION)),${PLUGIN_VERSION},${BUILD_TIME}-${COMMIT_ID})
IMG ?= ${REGISTRY}${PLUGIN_NAME}:${IMAGE_TAG}
GOPROXY := $(shell go env GOPROXY)
EXTRA_TAGS ?=
EXTRA_TAGS := $(shell [ -f extensions/${PLUGIN_NAME}/.buildrc ] && . extensions/${PLUGIN_NAME}/.buildrc && echo $$EXTRA_TAGS || echo "")

.DEFAULT:
build:
DOCKER_BUILDKIT=1 docker build --build-arg PLUGIN_NAME=${PLUGIN_NAME} \
--build-arg BUILDER=${BUILDER} \
--build-arg GOPROXY=$(GOPROXY) \
--build-arg EXTRA_TAGS=$(EXTRA_TAGS) \
--build-arg EXTRA_TAGS=${EXTRA_TAGS} \
-t ${IMG} \
--output extensions/${PLUGIN_NAME} \
.
Expand All @@ -30,7 +30,7 @@ build-image:
DOCKER_BUILDKIT=1 docker build --build-arg PLUGIN_NAME=${PLUGIN_NAME} \
--build-arg BUILDER=${BUILDER} \
--build-arg GOPROXY=$(GOPROXY) \
--build-arg EXTRA_TAGS=$(EXTRA_TAGS) \
--build-arg EXTRA_TAGS=${EXTRA_TAGS} \
-t ${IMG} \
.
@echo ""
Expand Down
2 changes: 2 additions & 0 deletions plugins/wasm-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
使用以下命令可以快速构建 wasm-go 插件:

```bash
# NOTE: 如果你想在构建插件的时候设置额外的构建参数 EXTRA_TAGS
# 请更新 extensions/${PLUGIN_NAME} 插件目录对应的 .buildrc 文件
$ PLUGIN_NAME=request-block make build
```

Expand Down
2 changes: 2 additions & 0 deletions plugins/wasm-go/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This SDK is used to develop the WASM Plugins for Higress in Go.
The wasm-go plugin can be built quickly with the following command:

```bash
# NOTE: if you want to set EXTRA_TAGS for the wasm plugin
# please set them in the .buildrc file under extensions/${PLUGIN_NAME} directory
$ PLUGIN_NAME=request-block make build
```

Expand Down

0 comments on commit d721c23

Please sign in to comment.