1 Star 0 Fork 0

Albert Lee/ekuiper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 3.63 KB
一键复制 编辑 原始数据 按行查看 历史
zhanghongtong 提交于 2021-10-15 18:48 . chore(CI): better build plugins
BUILD_PATH ?= _build
PACKAGES_PATH ?= _packages
VERSION := $(shell git describe --tags --always)
ARCH := $(shell go env GOARCH)
OS := $(shell go env GOOS)
PACKAGE_NAME := kuiper-$(VERSION)-$(OS)-$(ARCH)
TARGET ?= lfedge/ekuiper
export KUIPER_SOURCE := $(shell pwd)
.PHONY: build
build: build_without_edgex
.PHONY:pkg
pkg: pkg_without_edgex
@if [ "$$(uname -s)" = "Linux" ]; then make -C deploy/packages; fi
.PHONY: build_prepare
build_prepare:
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/bin
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/etc
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/etc/sources
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/etc/sinks
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/etc/services
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/etc/services/schemas
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/data
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/plugins
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/plugins/sources
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/plugins/sinks
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/plugins/functions
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/plugins/portable
@mkdir -p $(BUILD_PATH)/$(PACKAGE_NAME)/log
@cp -r etc/* $(BUILD_PATH)/$(PACKAGE_NAME)/etc
.PHONY: build_without_edgex
build_without_edgex: build_prepare
GO111MODULE=on CGO_ENABLED=1 go build -ldflags="-s -w -X main.Version=$(VERSION) -X main.LoadFileType=relative" -o kuiper cmd/kuiper/main.go
GO111MODULE=on CGO_ENABLED=1 go build -trimpath -ldflags="-s -w -X main.Version=$(VERSION) -X main.LoadFileType=relative" -o kuiperd cmd/kuiperd/main.go
@if [ ! -z $$(which upx) ]; then upx ./kuiper; upx ./kuiperd; fi
@mv ./kuiper ./kuiperd $(BUILD_PATH)/$(PACKAGE_NAME)/bin
@echo "Build successfully"
.PHONY: pkg_without_edgex
pkg_without_edgex: build_without_edgex
@make real_pkg
.PHONY: build_with_edgex
build_with_edgex: build_prepare
GO111MODULE=on CGO_ENABLED=1 go build -ldflags="-s -w -X main.Version=$(VERSION) -X main.LoadFileType=relative" -tags edgex -o kuiper cmd/kuiper/main.go
GO111MODULE=on CGO_ENABLED=1 go build -trimpath -ldflags="-s -w -X main.Version=$(VERSION) -X main.LoadFileType=relative" -tags edgex -o kuiperd cmd/kuiperd/main.go
@if [ ! -z $$(which upx) ]; then upx ./kuiper; upx ./kuiperd; fi
@mv ./kuiper ./kuiperd $(BUILD_PATH)/$(PACKAGE_NAME)/bin
@echo "Build successfully"
.PHONY: pkg_with_edgex
pkg_with_edgex: build_with_edgex
@make real_pkg
.PHONY: real_pkg
real_pkg:
@mkdir -p $(PACKAGES_PATH)
@cd $(BUILD_PATH) && zip -rq $(PACKAGE_NAME).zip $(PACKAGE_NAME)
@cd $(BUILD_PATH) && tar -czf $(PACKAGE_NAME).tar.gz $(PACKAGE_NAME)
@mv $(BUILD_PATH)/$(PACKAGE_NAME).zip $(BUILD_PATH)/$(PACKAGE_NAME).tar.gz $(PACKAGES_PATH)
@echo "Package build success"
.PHONY: docker
docker:
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION) -f deploy/docker/Dockerfile . --load
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION)-slim -f deploy/docker/Dockerfile-slim . --load
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION)-alpine -f deploy/docker/Dockerfile-alpine . --load
PLUGINS := sinks/file \
sinks/influx \
sinks/zmq \
sinks/image \
sinks/redis \
sources/random \
sources/zmq \
sinks/tdengine \
functions/accumulateWordCount \
functions/countPlusOne \
functions/image \
functions/geohash \
functions/echo \
functions/labelImage
.PHONY: plugins $(PLUGINS)
plugins: $(PLUGINS)
$(PLUGINS): PLUGIN_TYPE = $(word 1, $(subst /, , $@))
$(PLUGINS): PLUGIN_NAME = $(word 2, $(subst /, , $@))
$(PLUGINS):
@$(CURDIR)/build-plugins.sh $(PLUGIN_TYPE) $(PLUGIN_NAME)
.PHONY: clean
clean:
@rm -rf cross_build.tar linux_amd64 linux_arm64 linux_arm_v7 linux_386
@rm -rf _build _packages _plugins
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/haoyul/ekuiper.git
git@gitee.com:haoyul/ekuiper.git
haoyul
ekuiper
ekuiper
master

搜索帮助