From a37dc48c2af8f486b280a53bb317a53074875495 Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Fri, 8 Jul 2022 18:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=ACv1.14.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 + Dockerfile | 7 +- docker-compose.yml | 23 ++-- docker/activemq/activemq.xml | 2 +- docker/build-docker-starter.sh | 104 ++++++++++++++++++ push-to-docker.md => docker/push-to-docker.md | 8 +- docs/sql/patch.sql | 4 +- jeepay-manager/src/main/resources/banner.txt | 2 +- jeepay-merchant/src/main/resources/banner.txt | 2 +- jeepay-payment/src/main/resources/banner.txt | 2 +- jeepay-ui | 1 - pom.xml | 2 +- 12 files changed, 133 insertions(+), 26 deletions(-) create mode 100644 .env create mode 100644 docker/build-docker-starter.sh rename push-to-docker.md => docker/push-to-docker.md (88%) delete mode 160000 jeepay-ui diff --git a/.env b/.env new file mode 100644 index 0000000..cabce62 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +# ui项目的根路径 +UI_BASE_DIR=/Users/dingzhiwei/work/idea_wk/gitee_wk \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0076fbf..204b677 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,10 @@ COPY ./docs/settings.xml /root/.m2/settings.xml RUN mvn clean package -Dmaven.test.skip=true -Ptest - -# 以下为运行容器 切换 JDK 请修改后面的 17 到对应版本 -FROM mcr.microsoft.com/java/jre:17-zulu-alpine +# 以下为运行容器 切换 JDK 到对应版本 +# jdk8对应:mcr.microsoft.com/java/jre:8-zulu-alpine +# jdk17对应:mcr.microsoft.com/java/jre:17-zulu-alpine +FROM mcr.microsoft.com/java/jre:8-zulu-alpine ARG PLATFORM=$PLATFORM diff --git a/docker-compose.yml b/docker-compose.yml index 93a76a9..da03e27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,9 +17,10 @@ services: hostname: mysql container_name: jeepay-mysql # amd64 平台 - image: mysql/mysql-server:latest - #image: mysql:8 + #image: mysql/mysql-server:latest + image: mysql:8 environment: + LANG: C.UTF-8 MYSQL_ROOT_PASSWORD: "rootroot" MYSQL_DATABASE: "jeepaydb" MYSQL_USER: "jeepay" @@ -131,8 +132,8 @@ services: - mysql - redis - activemq - - rabbitmq - - rocketmq-broker + # - rabbitmq + # - rocketmq-broker networks: jeepay: ipv4_address: 172.20.0.21 @@ -155,8 +156,8 @@ services: - mysql - redis - activemq - - rabbitmq - - rocketmq-broker + # - rabbitmq + # - rocketmq-broker networks: jeepay: ipv4_address: 172.20.0.22 @@ -179,8 +180,8 @@ services: - mysql - redis - activemq - - rabbitmq - - rocketmq-broker + # - rabbitmq + # - rocketmq-broker networks: jeepay: ipv4_address: 172.20.0.23 @@ -189,7 +190,7 @@ services: - ./conf/merchant/application.yml:/workspace/application.yml ui-payment: build: - context: ./jeepay-ui + context: ${UI_BASE_DIR}/jeepay-ui dockerfile: Dockerfile args: PLATFORM: cashier @@ -207,7 +208,7 @@ services: ipv4_address: 172.20.0.31 ui-manager: build: - context: ./jeepay-ui + context: ${UI_BASE_DIR}/jeepay-ui dockerfile: Dockerfile args: PLATFORM: manager @@ -225,7 +226,7 @@ services: ipv4_address: 172.20.0.32 ui-merchant: build: - context: ./jeepay-ui + context: ${UI_BASE_DIR}/jeepay-ui dockerfile: Dockerfile args: PLATFORM: merchant diff --git a/docker/activemq/activemq.xml b/docker/activemq/activemq.xml index e9ec8cc..1cd2ac7 100644 --- a/docker/activemq/activemq.xml +++ b/docker/activemq/activemq.xml @@ -37,7 +37,7 @@ - + diff --git a/docker/build-docker-starter.sh b/docker/build-docker-starter.sh new file mode 100644 index 0000000..2b0565f --- /dev/null +++ b/docker/build-docker-starter.sh @@ -0,0 +1,104 @@ +#!/bin/sh +set -o errexit + +# 版本 +VERSION=latest +# DockerHub 用户名前缀 / 私有镜像仓库,需要提前登陆好,编译完成后会自动上传 +DOCKER_NAMESPACE=registry.cn-beijing.aliyuncs.com/jiquankeji +# 容器名字前缀 +IMAGE_NAME=jeepay +# buildx toolkit 名称 +BUILDER=${IMAGE_NAME}-builder +# 平台 +PLATFORM=linux/amd64,linux/arm64 +# 后端 Maven 依赖缓存 +BACKEND_DEPS_IMAGE_NAME=${DOCKER_NAMESPACE}/${IMAGE_NAME}-deps:$VERSION +FRONTEND_DEPS_IMAGE_NAME=${DOCKER_NAMESPACE}/${IMAGE_NAME}-ui-deps:$VERSION + +UI_FOLDER=./private-jeepay-ui + +TARGET=$1 +HAS_DEPS=$2 +ECHO_NAME=$3 + +docker_buildx() { + build_path=$1 + build_name=$2 + build_file=$3 + build_arg="" + + for i in "$@"; do + if [ "$i" = "$build_path" ] || [ "$i" = "$build_name" ] || [ "$i" = "$build_file" ]; then + continue + fi + build_arg="$build_arg --build-arg $i" + done + + if [ "$ECHO_NAME" = "name" ]; then + echo "${IMAGE_NAME}-${build_name}" + else + CMD="docker buildx build ${build_path} -f ${build_file} --platform ${PLATFORM} ${build_arg} -t ${DOCKER_NAMESPACE}/${IMAGE_NAME}-${build_name}:$VERSION --push" + echo "$CMD" + eval "$CMD" + fi +} + +build_backend() { + + echo "== 项目后端" + if [ "$HAS_DEPS" = "deps" ]; then + docker_buildx . deps docs/Dockerfile + fi + + docker_buildx . payment Dockerfile PORT=9216 PLATFORM=payment IMAGES="$BACKEND_DEPS_IMAGE_NAME" + + docker_buildx . manager Dockerfile PORT=9217 PLATFORM=manager IMAGES="$BACKEND_DEPS_IMAGE_NAME" + + docker_buildx . merchant Dockerfile PORT=9218 PLATFORM=merchant IMAGES="$BACKEND_DEPS_IMAGE_NAME" + +} + +build_frontend() { + + rm -rf ${UI_FOLDER} + git clone https://gitee.com/jeequan/jeepay-ui.git ${UI_FOLDER} + + echo "== 项目前端" + + if [ "$HAS_DEPS" = "deps" ]; then + docker_buildx ${UI_FOLDER} ui-deps "${UI_FOLDER}/Dockerfile-deps" + fi + + docker_buildx ${UI_FOLDER} ui-payment "${UI_FOLDER}/Dockerfile" PLATFORM=cashier IMAGES="$FRONTEND_DEPS_IMAGE_NAME" + + docker_buildx ${UI_FOLDER} ui-manager "${UI_FOLDER}/Dockerfile" PLATFORM=manager IMAGES="$FRONTEND_DEPS_IMAGE_NAME" + + docker_buildx ${UI_FOLDER} ui-merchant "${UI_FOLDER}/Dockerfile" PLATFORM=merchant IMAGES="$FRONTEND_DEPS_IMAGE_NAME" + +} + +build_deps() { + echo "== 项目依赖环境编译" + + docker_buildx ./docker/activemq activemq ./docker/activemq/Dockerfile +} + +if [ "$TARGET" != "" ]; then + docker buildx rm ${BUILDER} || true + + docker buildx create --use --name ${BUILDER} --platform linux/arm64,linux/amd64 +fi + +if [ "$TARGET" = "backend" ] || [ "$TARGET" = "all" ]; then + build_backend +fi + +if [ "$TARGET" = "frontend" ] || [ "$TARGET" = "all" ]; then + build_frontend +fi + +if [ "$TARGET" = "all" ]; then + build_deps +else + echo "./build-docker.sh [backend|frontend|all] [deps] [name]" +fi diff --git a/push-to-docker.md b/docker/push-to-docker.md similarity index 88% rename from push-to-docker.md rename to docker/push-to-docker.md index 01e820b..a0374c6 100644 --- a/push-to-docker.md +++ b/docker/push-to-docker.md @@ -6,25 +6,25 @@ mvn install ``` export DOCKER_REGISTRY=registry.cn-beijing.aliyuncs.com export DOCKER_NAMESPACE=jeequan -export DOCKER_IMAGE_TAG=v1.0-alpha +export DOCKER_IMAGE_TAG=v1.14.0-alpha export DOCKER_REGISTRY_USERNAME=username1 export DOCKER_REGISTRY_PASSWORD=password1 cd jeepay-payment mvn jib:build \ - -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-payment:v1.0-alpha \ + -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-payment:$DOCKER_IMAGE_TAG \ -Djib.to.auth.username=$DOCKER_REGISTRY_USERNAME \ -Djib.to.auth.password=$DOCKER_REGISTRY_PASSWORD cd ../jeepay-merchant mvn jib:build \ - -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-merchant:v1.0-alpha \ + -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-merchant:$DOCKER_IMAGE_TAG \ -Djib.to.auth.username=$DOCKER_REGISTRY_USERNAME \ -Djib.to.auth.password=$DOCKER_REGISTRY_PASSWORD cd ../jeepay-manager mvn jib:build \ - -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-manager:v1.0-alpha \ + -Djib.to.image=$DOCKER_REGISTRY/$DOCKER_NAMESPACE/jeepay-manager:$DOCKER_IMAGE_TAG \ -Djib.to.auth.username=$DOCKER_REGISTRY_USERNAME \ -Djib.to.auth.password=$DOCKER_REGISTRY_PASSWORD ``` diff --git a/docs/sql/patch.sql b/docs/sql/patch.sql index 66211f7..7463b07 100644 --- a/docs/sql/patch.sql +++ b/docs/sql/patch.sql @@ -251,7 +251,7 @@ VALUES ('wxpay', '微信支付官方', 1, 1, 2, '[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]', 'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道'); +## -- ++++ [v1.13.0] ===> [v1.14.0] ++++ -- 日志请求参数、响应参数长度修改 alter table t_sys_log modify `opt_req_param` TEXT DEFAULT NULL COMMENT '操作请求参数'; -alter table t_sys_log modify `opt_res_info` TEXT DEFAULT NULL COMMENT '操作响应结果'; - +alter table t_sys_log modify `opt_res_info` TEXT DEFAULT NULL COMMENT '操作响应结果'; \ No newline at end of file diff --git a/jeepay-manager/src/main/resources/banner.txt b/jeepay-manager/src/main/resources/banner.txt index dd47bfa..92512e3 100644 --- a/jeepay-manager/src/main/resources/banner.txt +++ b/jeepay-manager/src/main/resources/banner.txt @@ -4,5 +4,5 @@ / /_/ // __/ __/ /_/ / /_/ / /_/ / \____/ \___/\___/ .___/\__,_/\__, / /_/ /____/ - :: Jeepay :: (v1.13.0.RELEASE) + :: Jeepay :: (v1.14.0.RELEASE) 适合互联网企业使用的开源支付系统 : https://www.jeequan.com diff --git a/jeepay-merchant/src/main/resources/banner.txt b/jeepay-merchant/src/main/resources/banner.txt index dd47bfa..92512e3 100644 --- a/jeepay-merchant/src/main/resources/banner.txt +++ b/jeepay-merchant/src/main/resources/banner.txt @@ -4,5 +4,5 @@ / /_/ // __/ __/ /_/ / /_/ / /_/ / \____/ \___/\___/ .___/\__,_/\__, / /_/ /____/ - :: Jeepay :: (v1.13.0.RELEASE) + :: Jeepay :: (v1.14.0.RELEASE) 适合互联网企业使用的开源支付系统 : https://www.jeequan.com diff --git a/jeepay-payment/src/main/resources/banner.txt b/jeepay-payment/src/main/resources/banner.txt index dd47bfa..92512e3 100644 --- a/jeepay-payment/src/main/resources/banner.txt +++ b/jeepay-payment/src/main/resources/banner.txt @@ -4,5 +4,5 @@ / /_/ // __/ __/ /_/ / /_/ / /_/ / \____/ \___/\___/ .___/\__,_/\__, / /_/ /____/ - :: Jeepay :: (v1.13.0.RELEASE) + :: Jeepay :: (v1.14.0.RELEASE) 适合互联网企业使用的开源支付系统 : https://www.jeequan.com diff --git a/jeepay-ui b/jeepay-ui deleted file mode 160000 index e20d7f8..0000000 --- a/jeepay-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e20d7f8ddade37b465cb0d4091dcfb51890a7891 diff --git a/pom.xml b/pom.xml index fff6eec..80f87a3 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ - 1.13.0 + 1.14.0 1.8 UTF-8