This commit is contained in:
laodaming 2023-10-09 15:15:44 +08:00
parent d73d748436
commit 41949bef72
16 changed files with 53 additions and 14 deletions

View File

@ -2,6 +2,10 @@
name=${1%%\\*}
#进入对应服务目录
cd server/$name
#把https加密密钥对复制进来
cp /opt/env.yaml ./
cp /opt/server.fusen.3718.cn.pem ./
cp /opt/server.fusen.3718.cn.key ./
#构建二进制文件
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/api-$name-srv ./$name.go
#删除之前旧的镜像
@ -9,6 +13,10 @@ docker rmi -f api-$name-srv:latest
docker rmi -f registry.cn-hangzhou.aliyuncs.com/fusen-test/fusen_docker_hub:latest
#打包docker镜像
docker build -t api-$name-srv:latest .
#删除临时复制进来的文件
rm ./env.yaml
rm ./server.fusen.3718.cn.pem
rm ./server.fusen.3718.cn.key
#打tag(测试环境正式把命名空间fusentest改成fusen)
docker tag api-$name-srv:latest registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest
#推送到阿里云镜像库(测试环境正式把命名空间fusentest改成fusen)

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-assistant-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-assistant-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-canteen-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-canteen-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-collection-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-collection-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-data-transfer-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-data-transfer-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-home-user-auth-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-home-user-auth-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-map-library-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-map-library-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-pay-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-pay-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-product-model-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-product-model-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-product-template-tag-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-product-template-tag-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-product-template-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-product-template-srv"]

View File

@ -2,4 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-product-srv /www/fusenapi/
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-product-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-shopping-cart-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-shopping-cart-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-upload-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-upload-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-webset-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-webset-srv"]

View File

@ -2,5 +2,7 @@ FROM alpine
WORKDIR /www/fusenapi/
COPY ./bin/api-websocket-srv /www/fusenapi/
COPY ./etc /www/fusenapi/etc
COPY ./env.yaml /opt/
COPY ./server.fusen.3718.cn.pem /opt/
COPY ./server.fusen.3718.cn.key /opt/
CMD ["/www/fusenapi/api-websocket-srv"]