[REV] update Makefile

This commit is contained in:
ysicing 2018-06-08 18:02:06 +08:00
parent 6f31c04351
commit 1daac9da6e
2 changed files with 20 additions and 16 deletions

View File

@ -6,7 +6,7 @@ BASE_DOCKER=./hack/contrib/docker
BIN_PATH=./_output/${VERSION}
default: help
all: build pkgs images ## build linux binaries, build linux packages, build images for docker
all: build images ## build linux binaries, build images for docker
clean:
@rm -rf ${BIN_PATH}/*
@ -33,14 +33,14 @@ build-api:
build-webcli:
go build ${GO_LDFLAGS} -o ${BIN_PATH}/${BASE_NAME}-webcli ./cmd/webcli
deb: ## build the deb packages
deb:
@bash ./release.sh deb
rpm: ## build the rpm packages
rpm:
@bash ./release.sh rpm
pkgs:
@bash ./release.sh pkg
images: build-image-worker build-image-mq build-image-chaos build-image-entrance build-image-eventlog build-image-api build-image-webcli ## build all images
images: build-image-worker build-image-mq build-image-chaos build-image-entrance build-image-eventlog build-image-api build-image-webcli build-image-cni-tools ## build all images
build-image-worker:
@echo "🐳 $@"
@bash ./release.sh worker
@ -50,9 +50,9 @@ build-image-mq:
build-image-chaos:
@echo "🐳 $@"
@bash ./release.sh chaos
build-image-node:
build-image-cni-tools:
@echo "🐳 $@"
@bash ./release.sh node
@bash ./release.sh build
# @docker run -v `pwd`:${WORK_DIR} -w ${WORK_DIR} -it golang:1.8.3 go build ${GO_LDFLAGS} -o ${BASE_DOCKER}/node/${BASE_NAME}-node ./cmd/node
build-image-monitor:
@echo "🐳 $@"
@ -104,15 +104,11 @@ run-node:build-node
--statsd.mapping-config=`pwd`/test/mapper.yml \
--log-level=debug
doc: ## build the docs
doc:
@cd cmd/api && swagger generate spec -o ../../hack/contrib/docker/api/html/swagger.json
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo "\033[32m ❗❗❗ eventlog,entrance,chaos,mq,worker,webcli,api not support deb/rpm \033[0m"
@echo "\033[32m ❗❗❗ node,grctl not support image \033[0m"
@echo "\033[32m plugin: node,grctl,eventlog,entrance,chaos,mq,worker,webcli,api \033[0m"
@echo "\033[32m \033[0m"
@echo "\033[36m 🤔 single plugin,how to work? \033[0m"
@echo "\033[01;34mmake build-<plugin>\033[0m Just like: make build-mq"
@echo "\033[01;34mmake build-image-<plugin>\033[0m Just like: make build-image-mq"

View File

@ -22,7 +22,6 @@ function prepare() {
rm -rf $releasedir
mkdir -pv $releasedir/{tmp,dist}
path=$PWD
#git clone $gaops $releasedir/tmp
[ ! -d "$distdir/usr/local/" ] && mkdir -p $distdir/usr/local/bin
}
@ -30,12 +29,21 @@ function prepare() {
function build() {
echo "---> Build Binary For RBD"
echo "rbd plugins version:$release_desc"
# sed -i "s/0.0.0/$release_desc/g" ./cmd/version.go
echo "build rainbond-node"
echo "build node"
docker run --rm -v `pwd`:${WORK_DIR} -w ${WORK_DIR} -it golang:1.8.3 go build -ldflags '-w -s' -o $releasedir/dist/usr/local/bin/${BASE_NAME}-node ./cmd/node
echo "build rainbond-grctl"
echo "build grctl"
docker run --rm -v `pwd`:${WORK_DIR} -w ${WORK_DIR} -it golang:1.8.3 go build -ldflags '-w -s' -o $releasedir/dist/usr/local/bin/${BASE_NAME}-grctl ./cmd/grctl
# sed -i "s/$release_desc/0.0.0/g" ./cmd/version.go
cd $releasedir/dist/usr/local/
tar zcf pkg.tgz `find . -maxdepth 1|sed 1d`
cat >Dockerfile <<EOF
FROM alpine:3.6
COPY pkg.tgz /
EOF
docker build -t rainbond/cni:rbd_v3.6 .
}
function build::rpm() {