Bug fix test (#1061)
* fix 腾讯云COS上传配置无效 * Create docker-cicd.yaml * 修复InitDataFailed 打印bug Co-authored-by: tesun <36953434+tesun@users.noreply.github.com> Co-authored-by: task <ms.yangdan@gmail.com> Co-authored-by: task <121913992@qq.com> Co-authored-by: tscuite <tscuite@qq.com> Co-authored-by: tscuite <64051240+tscuite@users.noreply.github.com> Co-authored-by: wyh <yinhua_wu@arcplus.com.cn>
This commit is contained in:
61
Makefile
Normal file
61
Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
SHELL = /bin/bash
|
||||
|
||||
CONFIG_FILE = config.yaml
|
||||
PROJECT_NAME = github.com/flipped-aurora/gin-vue-admin/server
|
||||
#SCRIPT_DIR = $(shell pwd)/etc/script
|
||||
BUILD_IMAGE_SERVER = golang:1.16
|
||||
BUILD_IMAGE_WEB = node:16
|
||||
IMAGE_NAME = gva
|
||||
REPOSITORY = registry.cn-hangzhou.aliyuncs.com/${IMAGE_NAME}
|
||||
|
||||
ifeq ($(TAGS_OPT),)
|
||||
TAGS_OPT = 2.5.0b
|
||||
else
|
||||
endif
|
||||
|
||||
#容器环境前后端共同打包
|
||||
build: build-web build-server
|
||||
docker run --name build-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-local
|
||||
|
||||
#容器环境打包前端
|
||||
build-web:
|
||||
docker run --name build-web-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_WEB} make build-web-local
|
||||
|
||||
#容器环境打包后端
|
||||
build-server:
|
||||
docker run --name build-server-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-server-local
|
||||
|
||||
#构建web镜像
|
||||
build-image-web:
|
||||
@cd web/ && docker build -t ${REPOSITORY}/web:${TAGS_OPT} .
|
||||
|
||||
#构建server镜像
|
||||
build-image-server:
|
||||
@cd server/ && docker build -t ${REPOSITORY}/server:${TAGS_OPT} .
|
||||
|
||||
#本地环境打包前后端
|
||||
build-local:
|
||||
if [ -d "build" ];then rm -rf build; else echo "OK!"; fi \
|
||||
&& if [ -f "/.dockerenv" ];then echo "OK!"; else make build-web-local && make build-server-local; fi \
|
||||
&& mkdir build && cp -r web/dist build/ && cp server/server build/ && cp -r server/resource build/resource
|
||||
|
||||
#本地环境打包前端
|
||||
build-web-local:
|
||||
@cd web/ && if [ -d "dist" ];then rm -rf dist; else echo "OK!"; fi \
|
||||
&& yarn config set registry http://mirrors.cloud.tencent.com/npm/ \
|
||||
&& yarn install && yarn build
|
||||
|
||||
#本地环境打包后端
|
||||
build-server-local:
|
||||
@cd server/ && if [ -f "server" ];then rm -rf server; else echo "OK!"; fi \
|
||||
&& go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
|
||||
&& go env -w CGO_ENABLED=0 && go env && go mod tidy \
|
||||
&& go build -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -X main.Version=${TAGS_OPT}" -v
|
||||
|
||||
#打包前后端二合一镜像
|
||||
image: build
|
||||
docker build -t ${REPOSITORY}/all-one:${TAGS_OPT} .
|
||||
|
||||
#尝鲜版
|
||||
images: build build-image-web build-image-server
|
||||
docker build -t ${REPOSITORY}/all:${TAGS_OPT} .
|
Reference in New Issue
Block a user