From 8bd4d8c0a8406005662c7e9b79016548d5f1d952 Mon Sep 17 00:00:00 2001 From: powerkimhub Date: Tue, 15 Jun 2021 15:57:05 +0000 Subject: [PATCH] Add cli-dist Make option to build spctl distributed pkg --- Makefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fd542e8e0..b9b1b2ba0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -default: +default: cli @echo -e '\t[CB-Spider] build ./bin/cb-spider....' @go mod download @go build -o bin/cb-spider ./api-runtime - @go build -o ./interface/spctl ./interface/cli/spider/spider.go -dyna plugin plug dynamic: +dyna plugin plug dynamic: cli @echo -e '\t[CB-Spider] build ./bin/cb-spider with plugin mode...' @go mod download @go build -tags dyna -o bin/cb-spider-dyna ./api-runtime @@ -14,3 +13,16 @@ cc: clean clear: @echo -e '\t[CB-Spider] cleaning...' @rm -rf bin/cb-spider bin/cb-spider-dyna bin/cb-spider-arm + @rm -rf dist-tmp + +cli-dist: cli + @echo -e '\t[CB-Spider] tar spctl... to dist' + @mkdir -p /tmp/spider/dist/conf + @cp ./interface/spctl ./interface/grpc_conf.yaml /tmp/spider/dist 1> /dev/null + @cp ./conf/log_conf.yaml /tmp/spider/dist/conf 1> /dev/null + @mkdir -p ./dist + @tar -zcvf ./dist/spctl-`(date +%Y.%m.%d.%H)`.tar.gz -C /tmp/spider/dist ./ 1> /dev/null + @rm -rf /tmp/spider +cli: + @echo -e '\t[CB-Spider] build ./interface/spctl...' + @go build -o ./interface/spctl ./interface/cli/spider/spider.go