|
@@ -2,7 +2,9 @@ BUILD_PATH ?= _build
|
|
|
PACKAGES_PATH ?= _packages
|
|
|
|
|
|
VERSION := $(shell git describe --tags --always)
|
|
|
-PACKAGE_NAME := kuiper-$(VERSION)-$(shell go env GOOS)-$(shell go env GOARCH)
|
|
|
+ARCH := $(shell go env GOARCH)
|
|
|
+OS := $(shell go env GOOS)
|
|
|
+PACKAGE_NAME := kuiper-$(VERSION)-$(OS)-$(ARCH)
|
|
|
|
|
|
TARGET ?= lfedge/ekuiper
|
|
|
|
|
@@ -65,10 +67,6 @@ real_pkg:
|
|
|
@mv $(BUILD_PATH)/$(PACKAGE_NAME).zip $(BUILD_PATH)/$(PACKAGE_NAME).tar.gz $(PACKAGES_PATH)
|
|
|
@echo "Package build success"
|
|
|
|
|
|
-.PHONY:cross_prepare
|
|
|
-cross_prepare:
|
|
|
- @docker run --rm --privileged tonistiigi/binfmt --install all
|
|
|
-
|
|
|
.PHONY: docker
|
|
|
docker:
|
|
|
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION) -f deploy/docker/Dockerfile . --load
|
|
@@ -82,64 +80,21 @@ PLUGINS := sinks/file \
|
|
|
sinks/redis \
|
|
|
sources/random \
|
|
|
sources/zmq \
|
|
|
+ sinks/tdengine \
|
|
|
functions/accumulateWordCount \
|
|
|
functions/countPlusOne \
|
|
|
functions/image \
|
|
|
functions/geohash \
|
|
|
- functions/echo
|
|
|
-
|
|
|
-.PHONY: plugins sinks/tdengine $(PLUGINS)
|
|
|
-plugins: cross_prepare sinks/tdengine functions/labelImage $(PLUGINS)
|
|
|
-sinks/tdengine:
|
|
|
- @docker buildx build --no-cache \
|
|
|
- --platform=linux/amd64,linux/arm64 \
|
|
|
- -t cross_build \
|
|
|
- --build-arg VERSION=$(VERSION) \
|
|
|
- --build-arg PLUGIN_TYPE=sinks \
|
|
|
- --build-arg PLUGIN_NAME=tdengine \
|
|
|
- --output type=tar,dest=/tmp/cross_build_plugins_sinks_tdengine.tar \
|
|
|
- -f .ci/Dockerfile-plugins .
|
|
|
-
|
|
|
- @mkdir -p _plugins/debian/sinks
|
|
|
- @for arch in amd64 arm64; do \
|
|
|
- tar -xvf /tmp/cross_build_plugins_sinks_tdengine.tar --wildcards "linux_$${arch}/go/kuiper/plugins/sinks/tdengine/tdengine_$$(echo $${arch%%_*}).zip" \
|
|
|
- && mv $$(ls linux_$${arch}/go/kuiper/plugins/sinks/tdengine/tdengine_$$(echo $${arch%%_*}).zip) _plugins/debian/sinks; \
|
|
|
- done
|
|
|
- @rm -f /tmp/cross_build_plugins_sinks_tdengine.tar
|
|
|
-
|
|
|
-functions/labelImage:
|
|
|
- @docker buildx build --no-cache \
|
|
|
- --platform=linux/amd64 \
|
|
|
- -t cross_build \
|
|
|
- --build-arg VERSION=$(VERSION) \
|
|
|
- --build-arg PLUGIN_TYPE=functions \
|
|
|
- --build-arg PLUGIN_NAME=labelImage \
|
|
|
- --output type=tar,dest=/tmp/cross_build_plugins_functions_labelImage.tar \
|
|
|
- -f .ci/Dockerfile-plugins .
|
|
|
-
|
|
|
- @mkdir -p _plugins/debian/functions
|
|
|
- @tar -xvf /tmp/cross_build_plugins_functions_labelImage.tar --wildcards "go/kuiper/plugins/functions/labelImage/labelImage_amd64.zip"
|
|
|
- @mv $$(ls go/kuiper/plugins/functions/labelImage/labelImage_amd64.zip) _plugins/debian/functions
|
|
|
- @rm -f /tmp/cross_build_plugins_functions_labelImage.tar
|
|
|
+ functions/echo \
|
|
|
+ functions/labelImage
|
|
|
+
|
|
|
+.PHONY: plugins $(PLUGINS)
|
|
|
+plugins: $(PLUGINS)
|
|
|
|
|
|
$(PLUGINS): PLUGIN_TYPE = $(word 1, $(subst /, , $@))
|
|
|
$(PLUGINS): PLUGIN_NAME = $(word 2, $(subst /, , $@))
|
|
|
$(PLUGINS):
|
|
|
- @docker buildx build --no-cache \
|
|
|
- --platform=linux/amd64,linux/arm64,linux/arm/v7,linux/386 \
|
|
|
- -t cross_build \
|
|
|
- --build-arg VERSION=$(VERSION) \
|
|
|
- --build-arg PLUGIN_TYPE=$(PLUGIN_TYPE)\
|
|
|
- --build-arg PLUGIN_NAME=$(PLUGIN_NAME)\
|
|
|
- --output type=tar,dest=/tmp/cross_build_plugins_$(PLUGIN_TYPE)_$(PLUGIN_NAME).tar \
|
|
|
- -f .ci/Dockerfile-plugins .
|
|
|
-
|
|
|
- @mkdir -p _plugins/debian/$(PLUGIN_TYPE)
|
|
|
- @for arch in amd64 arm64 arm_v7 386; do \
|
|
|
- tar -xvf /tmp/cross_build_plugins_$(PLUGIN_TYPE)_$(PLUGIN_NAME).tar --wildcards "linux_$${arch}/go/kuiper/plugins/$(PLUGIN_TYPE)/$(PLUGIN_NAME)/$(PLUGIN_NAME)_$$(echo $${arch%%_*}).zip" \
|
|
|
- && mv $$(ls linux_$${arch}/go/kuiper/plugins/$(PLUGIN_TYPE)/$(PLUGIN_NAME)/$(PLUGIN_NAME)_$$(echo $${arch%%_*}).zip) _plugins/debian/$(PLUGIN_TYPE); \
|
|
|
- done
|
|
|
- @rm -f /tmp/cross_build_plugins_$(PLUGIN_TYPE)_$(PLUGIN_NAME).tar
|
|
|
+ @$(CURDIR)/build-plugins.sh $(PLUGIN_TYPE) $(PLUGIN_NAME)
|
|
|
|
|
|
.PHONY: clean
|
|
|
clean:
|