From b92ee90e63b5a4e71eb9616a6b601cd10f8df818 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 19 Sep 2024 11:02:33 +0800 Subject: [PATCH 01/34] ... --- hua_wei_yun/10wms86-test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hua_wei_yun/10wms86-test.sh b/hua_wei_yun/10wms86-test.sh index 299afb2..cc1933a 100644 --- a/hua_wei_yun/10wms86-test.sh +++ b/hua_wei_yun/10wms86-test.sh @@ -152,6 +152,10 @@ deployPull() { needBuild[idx]=$isChange fi done + echo -e "$echoPrefix cd /home/www/deploy/wms85_sd_test/wms-ui/node_modules/yvan-ui $echoSuffix" + cd /home/www/deploy/wms85_sd_test/wms-ui/node_modules/yvan-ui + echo -e "$echoPrefix git pull $echoSuffix" + git pull echo "###--代码更新完成--------------------------------------------------------------------------###" echo "" } From be66ff3214d3ba2d3d0a76057ee8972e035b8958 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 17 Oct 2024 10:00:58 +0800 Subject: [PATCH 02/34] demo-deploy.sh --- nanyao/test/logistic-wms.groovy | 117 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 nanyao/test/logistic-wms.groovy diff --git a/nanyao/test/logistic-wms.groovy b/nanyao/test/logistic-wms.groovy new file mode 100644 index 0000000..eebe31d --- /dev/null +++ b/nanyao/test/logistic-wms.groovy @@ -0,0 +1,117 @@ +//file:noinspection ALL +pipeline { + agent any + + environment { + projectName = 'logistic-wms' + // 源码配置 + gitCredentials = '98b675d5-b623-4b76-85eb-28a6ed865100' + // 构建配置 + baseDir = "${WORKSPACE}/" + dockerImgTag = "$projectName:v$BUILD_NUMBER" + dockerfileTarget = 'test' + // harbor配置 + harborProtocol = 'https://' + harborIP = 'swr.cn-east-3.myhuaweicloud.com' + harborCredentials = credentials('6de05cdf-c772-4658-8e15-94aec51283cd') + harborRepositorie = 'wlyc-dev' + // 部署配置 + imagePullSecrets = 'hw-swr-auth' + k8sNamespace = 'nanyao' + containerPort = '8080' + nodePort = 'false' + logging = 'enable' + springProfiles = 'test' + // 自定义环境变量 + JAVA_HOME = "/usr/local/jdk1.8.0_321" + NODE_HOME = "/usr/local/node-v14.20.1-linux-x64" + PATH = "$JAVA_HOME/bin:$NODE_HOME/bin:$PATH" + } + + stages { + stage('#检查环境') { + steps { + sh """ + java -version + node -v + helm version + """ + } + } + + stage('#拉取代码') { + steps { + checkout([ + $class : 'GitSCM', + branches : [[name: '*/main']], + userRemoteConfigs: [[url: "https://code.50yc.com/yypt/logistic-master.git", credentialsId: "${gitCredentials}"]], + extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: './']], + ]) + checkout([ + $class : 'GitSCM', + branches : [[name: '*/main']], + userRemoteConfigs: [[url: "https://code.50yc.com/yypt/logistic-wms.git", credentialsId: "${gitCredentials}"]], + extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: './logistic-wms/']], + ]) + } + } + + stage('#编译项目') { + steps { + sh """ + chmod +x gradlew + ./gradlew build -x test + """ + } + } + + stage('#构建镜像') { + steps { + sh """ + cd $baseDir + pwd + sudo docker build -f ./Dockerfile-logistic-wms --target $dockerfileTarget -t $dockerImgTag $baseDir + """ + } + } + + stage('#推送镜像') { + steps { + sh 'sudo docker login --username $harborCredentials_USR --password $harborCredentials_PSW $harborProtocol$harborIP' + sh "sudo docker tag $dockerImgTag $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker push $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $dockerImgTag" + } + } + + stage('#部署服务') { + steps { + sh """ + helm repo add lizw-repo https://gitee.com/LiZhiW/helm-chart/raw/master + helm repo update lizw-repo + """ + script { + def deployCMD = new StringBuilder() + deployCMD.append("helm upgrade --install $projectName lizw-repo/java01") + deployCMD.append(" --namespace $k8sNamespace --create-namespace") + deployCMD.append(" --version 0.0.1") + deployCMD.append(" --set env.SPRING_PROFILES='$springProfiles'") + deployCMD.append(" --set env.JAVA_MEM_OPTS='-server -Xms256m -Xmx256m'") + //deployCMD.append(" --set env.JAVA_ADD_OPENS='--add-exports=org.graalvm.truffle/com.oracle.truffle.api.interop=ALL-UNNAMED'") + deployCMD.append(" --set image='$harborIP/$harborRepositorie/$dockerImgTag'") + deployCMD.append(" --set imagePullSecrets='$imagePullSecrets'") + deployCMD.append(" --set containerPort='$containerPort'") + deployCMD.append(" --set nodePort='$nodePort'") + deployCMD.append(" --set labels.logging=$logging") + //deployCMD.append(" --set nodeSelector.enable='true'") + //deployCMD.append(" --set nodeSelector.values\\[0\\]='master1'") + //deployCMD.append(" --set nodeSelector.values\\[1\\]='worker1'") + deployCMD.append(" --set livenessProbe.initialDelaySeconds='60'") + deployCMD.append(" --set readinessProbe.initialDelaySeconds='60'") + sh deployCMD.toString() + } + } + } + } +} From a097ae9808bb27e51ec891e60162f5ecf6bcb6a9 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 17 Oct 2024 10:27:53 +0800 Subject: [PATCH 03/34] demo-deploy.sh --- nanyao/test/logistic-oms.groovy | 117 ++++++++++++++++++++++++++++++++++++++++ nanyao/test/logistic-wms.groovy | 2 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 nanyao/test/logistic-oms.groovy diff --git a/nanyao/test/logistic-oms.groovy b/nanyao/test/logistic-oms.groovy new file mode 100644 index 0000000..13562be --- /dev/null +++ b/nanyao/test/logistic-oms.groovy @@ -0,0 +1,117 @@ +//file:noinspection ALL +pipeline { + agent any + + environment { + projectName = 'logistic-oms' + // 源码配置 + gitCredentials = '98b675d5-b623-4b76-85eb-28a6ed865100' + // 构建配置 + baseDir = "${WORKSPACE}/" + dockerImgTag = "$projectName:v$BUILD_NUMBER" + dockerfileTarget = 'test' + // harbor配置 + harborProtocol = 'https://' + harborIP = 'swr.cn-east-3.myhuaweicloud.com' + harborCredentials = credentials('6de05cdf-c772-4658-8e15-94aec51283cd') + harborRepositorie = 'wlyc-dev' + // 部署配置 + imagePullSecrets = 'hw-swr-auth' + k8sNamespace = 'nanyao' + containerPort = '8080' + nodePort = 'false' + logging = 'enable' + springProfiles = 'test' + // 自定义环境变量 + JAVA_HOME = "/usr/local/jdk1.8.0_321" + NODE_HOME = "/usr/local/node-v14.20.1-linux-x64" + PATH = "$JAVA_HOME/bin:$NODE_HOME/bin:$PATH" + } + + stages { + stage('#检查环境') { + steps { + sh """ + java -version + node -v + helm version + """ + } + } + + stage('#拉取代码') { + steps { + checkout([ + $class : 'GitSCM', + branches : [[name: '*/main']], + userRemoteConfigs: [[url: "https://code.50yc.com/yypt/logistic-master.git", credentialsId: "${gitCredentials}"]], + extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: './']], + ]) + checkout([ + $class : 'GitSCM', + branches : [[name: '*/main']], + userRemoteConfigs: [[url: "https://code.50yc.com/yypt/logistic-oms.git", credentialsId: "${gitCredentials}"]], + extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: './logistic-oms/']], + ]) + } + } + + stage('#编译项目') { + steps { + sh """ + chmod +x gradlew + ./gradlew build -x test + """ + } + } + + stage('#构建镜像') { + steps { + sh """ + cd $baseDir + pwd + sudo docker build -f ./Dockerfile-logistic-oms --target $dockerfileTarget -t $dockerImgTag $baseDir + """ + } + } + + stage('#推送镜像') { + steps { + sh 'sudo docker login --username $harborCredentials_USR --password $harborCredentials_PSW $harborProtocol$harborIP' + sh "sudo docker tag $dockerImgTag $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker push $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $dockerImgTag" + } + } + + stage('#部署服务') { + steps { + sh """ + helm repo add lizw-repo https://gitee.com/LiZhiW/helm-chart/raw/master + helm repo update lizw-repo + """ + script { + def deployCMD = new StringBuilder() + deployCMD.append("helm upgrade --install $projectName lizw-repo/java01") + deployCMD.append(" --namespace $k8sNamespace --create-namespace") + deployCMD.append(" --version 0.0.1") + deployCMD.append(" --set env.SPRING_PROFILES='$springProfiles'") + deployCMD.append(" --set env.JAVA_MEM_OPTS='-server -Xms1024m -Xmx1024m'") + //deployCMD.append(" --set env.JAVA_ADD_OPENS='--add-exports=org.graalvm.truffle/com.oracle.truffle.api.interop=ALL-UNNAMED'") + deployCMD.append(" --set image='$harborIP/$harborRepositorie/$dockerImgTag'") + deployCMD.append(" --set imagePullSecrets='$imagePullSecrets'") + deployCMD.append(" --set containerPort='$containerPort'") + deployCMD.append(" --set nodePort='$nodePort'") + deployCMD.append(" --set labels.logging=$logging") + //deployCMD.append(" --set nodeSelector.enable='true'") + //deployCMD.append(" --set nodeSelector.values\\[0\\]='master1'") + //deployCMD.append(" --set nodeSelector.values\\[1\\]='worker1'") + deployCMD.append(" --set livenessProbe.initialDelaySeconds='60'") + deployCMD.append(" --set readinessProbe.initialDelaySeconds='60'") + sh deployCMD.toString() + } + } + } + } +} diff --git a/nanyao/test/logistic-wms.groovy b/nanyao/test/logistic-wms.groovy index eebe31d..c569876 100644 --- a/nanyao/test/logistic-wms.groovy +++ b/nanyao/test/logistic-wms.groovy @@ -97,7 +97,7 @@ pipeline { deployCMD.append(" --namespace $k8sNamespace --create-namespace") deployCMD.append(" --version 0.0.1") deployCMD.append(" --set env.SPRING_PROFILES='$springProfiles'") - deployCMD.append(" --set env.JAVA_MEM_OPTS='-server -Xms256m -Xmx256m'") + deployCMD.append(" --set env.JAVA_MEM_OPTS='-server -Xms1024m -Xmx1024m'") //deployCMD.append(" --set env.JAVA_ADD_OPENS='--add-exports=org.graalvm.truffle/com.oracle.truffle.api.interop=ALL-UNNAMED'") deployCMD.append(" --set image='$harborIP/$harborRepositorie/$dockerImgTag'") deployCMD.append(" --set imagePullSecrets='$imagePullSecrets'") From ba108e3b7c3d87de2b1094d1a654915e8df3b6ad Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 17 Oct 2024 15:44:56 +0800 Subject: [PATCH 04/34] demo-deploy.sh --- nanyao/test/logistic-front.groovy | 121 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 nanyao/test/logistic-front.groovy diff --git a/nanyao/test/logistic-front.groovy b/nanyao/test/logistic-front.groovy new file mode 100644 index 0000000..37a3f87 --- /dev/null +++ b/nanyao/test/logistic-front.groovy @@ -0,0 +1,121 @@ +//file:noinspection ALL +pipeline { + agent any + + environment { + projectName = 'logistic-front' + // 源码配置 + gitCredentials = '98b675d5-b623-4b76-85eb-28a6ed865100' + // 构建配置 + baseDir = "${WORKSPACE}/" + dockerImgTag = "$projectName:v$BUILD_NUMBER" + dockerfileTarget = 'test' + // harbor配置 + harborProtocol = 'https://' + harborIP = 'swr.cn-east-3.myhuaweicloud.com' + harborCredentials = credentials('6de05cdf-c772-4658-8e15-94aec51283cd') + harborRepositorie = 'wlyc-dev' + // 部署配置 + imagePullSecrets = 'hw-swr-auth' + k8sNamespace = 'nanyao' + containerPort = '8080' + nodePort = 'false' + logging = 'enable' + // 自定义环境变量 + JAVA_HOME = "/usr/local/jdk1.8.0_321" + NODE_HOME = "/usr/local/node-v14.20.1-linux-x64" + PATH = "$JAVA_HOME/bin:$NODE_HOME/bin:$PATH" + } + + stages { + stage('#检查环境') { + steps { + sh """ + java -version + node -v + helm version + """ + } + } + + stage('#拉取代码') { + steps { + checkout([ + $class : 'GitSCM', + branches : [[name: '*/main']], + userRemoteConfigs: [[url: "https://code.50yc.com/yypt/logistic-master.git", credentialsId: "${gitCredentials}"]], + extensions : [[$class: 'RelativeTargetDirectory', relativeTargetDir: './']], + ]) + } + } + + stage('#编译项目') { + steps { + sh """ + npm config set registry https://registry.npmjs.org/ + yarn config set registry https://registry.npmjs.org/ -g + cd $baseDir + cd front/public/yvan-ui + git pull + cd $baseDir + cp -r front/public/yvan-ui/ front/node_modules/ + cp -r front/node_modules/yvan-ui/dist/js/ front/public/ + cd $baseDir + cd front + ls -hl + ls -hl public + ls -hl public/yvan-ui + ls -hl node_modules + ls -hl node_modules/yvan-ui + """ + } + } + + stage('#构建镜像') { + steps { + sh """ + cd $baseDir + pwd + sudo docker build -f ./Dockerfile-logistic-front --target $dockerfileTarget -t $dockerImgTag $baseDir + """ + } + } + + stage('#推送镜像') { + steps { + sh 'sudo docker login --username $harborCredentials_USR --password $harborCredentials_PSW $harborProtocol$harborIP' + sh "sudo docker tag $dockerImgTag $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker push $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $harborIP/$harborRepositorie/$dockerImgTag" + sh "sudo docker rmi $dockerImgTag" + } + } + + stage('#部署服务') { + steps { + sh """ + helm repo add lizw-repo https://gitee.com/LiZhiW/helm-chart/raw/master + helm repo update lizw-repo + """ + script { + def deployCMD = new StringBuilder() + deployCMD.append("helm upgrade --install $projectName lizw-repo/node01") + deployCMD.append(" --namespace $k8sNamespace --create-namespace") + deployCMD.append(" --version 0.0.1") + deployCMD.append(" --set env.CMD_PARAMS=''") + deployCMD.append(" --set image='$harborIP/$harborRepositorie/$dockerImgTag'") + deployCMD.append(" --set imagePullSecrets='$imagePullSecrets'") + deployCMD.append(" --set containerPort='$containerPort'") + deployCMD.append(" --set nodePort='$nodePort'") + deployCMD.append(" --set labels.logging=$logging") + //deployCMD.append(" --set nodeSelector.enable='true'") + //deployCMD.append(" --set nodeSelector.values\\[0\\]='master1'") + //deployCMD.append(" --set nodeSelector.values\\[1\\]='worker1'") + deployCMD.append(" --set livenessProbe.initialDelaySeconds='10'") + deployCMD.append(" --set readinessProbe.initialDelaySeconds='10'") + sh deployCMD.toString() + } + } + } + } +} From 9deffea6b66635e85f7c747b16befa3b9f5d4bf3 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 11:45:25 +0800 Subject: [PATCH 05/34] ... --- dsl/001sync_code.sh | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 dsl/001sync_code.sh diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh new file mode 100644 index 0000000..e8f37b9 --- /dev/null +++ b/dsl/001sync_code.sh @@ -0,0 +1,90 @@ +#!/bin/bash +#set -x +set -e + +source_path=/home/www/sync_code/sd_dsl/wms85std +source_git=( + "www@git.yvanui.com:jztd/wms85std.git" + "www@git.yvanui.com:lizhiwei/yvan-framework.git" + "www@git.yvanui.com:luoyifan/yvan-ui.git" +) +source_branch=( + "sd_dsl2" + "8.6" + "master" +) +source_position=( + "." + "yvan-framework" + "yvan-ui" +) + +target_path=/home/www/sync_code/sd_dsl/wms85std-sd +target_git=www@git.yvanui.com:lizhiwei/wms85std-sd.git +target_branch=master +target_position=. + +echoPrefix="\033[36m+" +echoSuffix="\033[0m" + +# 强制覆盖本地的代码 git fetch --all && git reset --hard origin/master +pullCode() { + # Usage: pullCode "codePath" "gitUrl" "branch" "position" + path=$1 # 代码保存路径 + gitUrl=$2 # git仓库地址 + branch=${3:-"master"} # git分支 + position=${4:-""} # 使用“.”clone到当前文件夹 + # 创建文件夹 + if [ ! -d "$path" ]; then + echo -e "$echoPrefix 请检查服务器是否正确,再执行: mkdir -p $path $echoSuffix" + exit + fi + + # git clone + echo -e "$echoPrefix cd $path $echoSuffix" + cd $path + if [ "`ls -A $path`" == "" ] || [ ! -d "$path/$position" ] || [ "`ls -A $path/$position`" = "" ]; then + echo -e "$echoPrefix git clone $gitUrl $position $echoSuffix" + git clone $gitUrl $position + fi + + # 进入文件夹,切换分支,git pull + if [ "$position" != "" ]; then + echo -e "$echoPrefix cd $position $echoSuffix" + cd $position + fi + echo -e "$echoPrefix git checkout $branch $echoSuffix" + git checkout $branch + echo -e "$echoPrefix git checkout . $echoSuffix" + git checkout . + echo -e "$echoPrefix git pull $echoSuffix" + if [ "`git pull`" == "Already up-to-date." ]; then + fi + echo "" +} + +source_pull() { + for ((idx=0; idx<${#source_git[@]}; idx++)); do + pullCode $source_path ${source_git[idx]} ${source_branch[idx]} ${source_position[idx]} + done +} + +source_build() { + # 构建 java + echo -e "$echoPrefix cd $source_path $echoSuffix" + cd $source_path + chmod +x gradlew + echo -e "$echoPrefix gradlew build -x test $echoSuffix" + ./gradlew build -x test + echo "" +} + +target_pull() { + pullCode $target_path ${target_git} ${target_branch} ${target_position} +} + +source_pull +source_build +target_pull + +# bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From 5807c141f5ebf2dc25b5db81dd31d5b45dd0ddc8 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 11:50:50 +0800 Subject: [PATCH 06/34] ... --- dsl/001sync_code.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index e8f37b9..49700e6 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -59,6 +59,7 @@ pullCode() { git checkout . echo -e "$echoPrefix git pull $echoSuffix" if [ "`git pull`" == "Already up-to-date." ]; then + echo "" fi echo "" } From 15064609cc57596288a572b83795a14688683b19 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:27:59 +0800 Subject: [PATCH 07/34] ... --- dsl/001sync_code.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 49700e6..00f69d3 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -74,9 +74,8 @@ source_build() { # 构建 java echo -e "$echoPrefix cd $source_path $echoSuffix" cd $source_path - chmod +x gradlew - echo -e "$echoPrefix gradlew build -x test $echoSuffix" - ./gradlew build -x test + echo -e "$echoPrefix gradle build -x test $echoSuffix" + gradle build -x test echo "" } From 51efc77563cf2d57a1b05810b7c7afe84aa9caad Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:32:33 +0800 Subject: [PATCH 08/34] ... --- dsl/001sync_code.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 00f69d3..5754e43 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -21,7 +21,7 @@ source_position=( target_path=/home/www/sync_code/sd_dsl/wms85std-sd target_git=www@git.yvanui.com:lizhiwei/wms85std-sd.git -target_branch=master +target_branch=develop target_position=. echoPrefix="\033[36m+" @@ -83,6 +83,10 @@ target_pull() { pullCode $target_path ${target_git} ${target_branch} ${target_position} } + + + + source_pull source_build target_pull From d939f0f0085c56e7766bb788a9fa108315c01dff Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:32:51 +0800 Subject: [PATCH 09/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 5754e43..f368d06 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -21,7 +21,7 @@ source_position=( target_path=/home/www/sync_code/sd_dsl/wms85std-sd target_git=www@git.yvanui.com:lizhiwei/wms85std-sd.git -target_branch=develop +target_branch=main target_position=. echoPrefix="\033[36m+" From 55e0a4800c829de123dfcb0c65b9c6253104ee3c Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:49:54 +0800 Subject: [PATCH 10/34] ... --- dsl/001sync_code.sh | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index f368d06..8ff23d8 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -83,12 +83,45 @@ target_pull() { pullCode $target_path ${target_git} ${target_branch} ${target_position} } +sync_files() { + echo -e "$echoPrefix 开始同步 $echoSuffix" + rsync -azvr --progress \ + --exclude '*\.git\' \ + --exclude '*\.gradle\' \ + --exclude '*\.httpCache\' \ + --exclude '*\.idea\' \ + --exclude '*\logs\' \ + --exclude '*\build\' \ + --exclude '*\out\' \ + --exclude '*\node_modules\' \ + --exclude '*\yvan-framework\' \ + --exclude '*\yvan-ui\' \ + --exclude '*\build.gradle' \ + --exclude '*\settings.gradle' \ + --exclude '*\application*' \ + --exclude '*\bootstrap*' \ + --exclude '*\wms-print\' \ + --exclude '*\generated\' \ + --exclude '*\generated_tests\' \ + --exclude '*\*.bpmn' \ + --exclude '*\wms-modules\yvan-studio\*' \ + --exclude '*\gradle.properties' \ + --exclude '*\gradle-wrapper.properties' \ + --exclude '*\Dockerfile-wms-config-center' \ + --exclude '*\Dockerfile-wms-print' \ + --exclude '*\Dockerfile-wms-ui-config-center' \ + --exclude '*\Dockerfile-wms-ui-mobile' \ + --exclude '*\Dockerfile-wms-ui-pc' \ + --exclude '*\Dockerfile-wms-system' \ + $source_path $target_path + echo -e "$echoPrefix 同步完成 $echoSuffix" - - +} source_pull source_build target_pull +sync_files + # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From 6e783c42e4133abc65fdf661bbf4ba3e453a56ac Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:54:29 +0800 Subject: [PATCH 11/34] ... --- dsl/001sync_code.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 8ff23d8..cff007f 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -113,13 +113,12 @@ sync_files() { --exclude '*\Dockerfile-wms-ui-mobile' \ --exclude '*\Dockerfile-wms-ui-pc' \ --exclude '*\Dockerfile-wms-system' \ - $source_path $target_path + $source_path /home/www/sync_code/sd_dsl/wms85std_copy echo -e "$echoPrefix 同步完成 $echoSuffix" - } source_pull -source_build +#source_build target_pull sync_files From 25225b78811fd00bf6254a291572832e00b39ca4 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 13:57:21 +0800 Subject: [PATCH 12/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index cff007f..37fc519 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -113,7 +113,7 @@ sync_files() { --exclude '*\Dockerfile-wms-ui-mobile' \ --exclude '*\Dockerfile-wms-ui-pc' \ --exclude '*\Dockerfile-wms-system' \ - $source_path /home/www/sync_code/sd_dsl/wms85std_copy + $source_path/ /home/www/sync_code/sd_dsl/wms85std_copy echo -e "$echoPrefix 同步完成 $echoSuffix" } From cc9f512a894d5eeda199539400517008e47b7460 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 14:01:08 +0800 Subject: [PATCH 13/34] ... --- dsl/001sync_code.sh | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 37fc519..637ff38 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -86,33 +86,33 @@ target_pull() { sync_files() { echo -e "$echoPrefix 开始同步 $echoSuffix" rsync -azvr --progress \ - --exclude '*\.git\' \ - --exclude '*\.gradle\' \ - --exclude '*\.httpCache\' \ - --exclude '*\.idea\' \ - --exclude '*\logs\' \ - --exclude '*\build\' \ - --exclude '*\out\' \ - --exclude '*\node_modules\' \ - --exclude '*\yvan-framework\' \ - --exclude '*\yvan-ui\' \ - --exclude '*\build.gradle' \ - --exclude '*\settings.gradle' \ - --exclude '*\application*' \ - --exclude '*\bootstrap*' \ - --exclude '*\wms-print\' \ - --exclude '*\generated\' \ - --exclude '*\generated_tests\' \ - --exclude '*\*.bpmn' \ - --exclude '*\wms-modules\yvan-studio\*' \ - --exclude '*\gradle.properties' \ - --exclude '*\gradle-wrapper.properties' \ - --exclude '*\Dockerfile-wms-config-center' \ - --exclude '*\Dockerfile-wms-print' \ - --exclude '*\Dockerfile-wms-ui-config-center' \ - --exclude '*\Dockerfile-wms-ui-mobile' \ - --exclude '*\Dockerfile-wms-ui-pc' \ - --exclude '*\Dockerfile-wms-system' \ + --exclude '*/.git/' \ + --exclude '*/.gradle/' \ + --exclude '*/.httpCache/' \ + --exclude '*/.idea/' \ + --exclude '*/logs/' \ + --exclude '*/build/' \ + --exclude '*/out/' \ + --exclude '*/node_modules/' \ + --exclude '*/yvan-framework/' \ + --exclude '*/yvan-ui/' \ + --exclude '*/build.gradle' \ + --exclude '*/settings.gradle' \ + --exclude '*/application*' \ + --exclude '*/bootstrap*' \ + --exclude '*/wms-print/' \ + --exclude '*/generated/' \ + --exclude '*/generated_tests/' \ + --exclude '*/*.bpmn' \ + --exclude '*/wms-modules/yvan-studio/*' \ + --exclude '*/gradle.properties' \ + --exclude '*/gradle-wrapper.properties' \ + --exclude '*/Dockerfile-wms-config-center' \ + --exclude '*/Dockerfile-wms-print' \ + --exclude '*/Dockerfile-wms-ui-config-center' \ + --exclude '*/Dockerfile-wms-ui-mobile' \ + --exclude '*/Dockerfile-wms-ui-pc' \ + --exclude '*/Dockerfile-wms-system' \ $source_path/ /home/www/sync_code/sd_dsl/wms85std_copy echo -e "$echoPrefix 同步完成 $echoSuffix" } From 3b8d1741334e9eccf7b6988b9bdda9f50d302c99 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 14:51:32 +0800 Subject: [PATCH 14/34] ... --- dsl/001sync_code.sh | 89 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 637ff38..c5ce383 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -84,36 +84,62 @@ target_pull() { } sync_files() { - echo -e "$echoPrefix 开始同步 $echoSuffix" - rsync -azvr --progress \ - --exclude '*/.git/' \ - --exclude '*/.gradle/' \ - --exclude '*/.httpCache/' \ - --exclude '*/.idea/' \ - --exclude '*/logs/' \ - --exclude '*/build/' \ - --exclude '*/out/' \ - --exclude '*/node_modules/' \ - --exclude '*/yvan-framework/' \ - --exclude '*/yvan-ui/' \ - --exclude '*/build.gradle' \ - --exclude '*/settings.gradle' \ - --exclude '*/application*' \ - --exclude '*/bootstrap*' \ - --exclude '*/wms-print/' \ - --exclude '*/generated/' \ - --exclude '*/generated_tests/' \ - --exclude '*/*.bpmn' \ - --exclude '*/wms-modules/yvan-studio/*' \ - --exclude '*/gradle.properties' \ - --exclude '*/gradle-wrapper.properties' \ - --exclude '*/Dockerfile-wms-config-center' \ - --exclude '*/Dockerfile-wms-print' \ - --exclude '*/Dockerfile-wms-ui-config-center' \ - --exclude '*/Dockerfile-wms-ui-mobile' \ - --exclude '*/Dockerfile-wms-ui-pc' \ - --exclude '*/Dockerfile-wms-system' \ - $source_path/ /home/www/sync_code/sd_dsl/wms85std_copy + echo -e "$echoPrefix 开始同步: $source_path $echoSuffix" + rsync -azr --progress --delete \ + --exclude '.git/' \ + --exclude '.gradle/' \ + --exclude '.httpCache/' \ + --exclude '.idea/' \ + --exclude 'logs/' \ + --exclude 'build/' \ + --exclude 'out/' \ + --exclude 'libs/' \ + --exclude 'node_modules/' \ + --exclude 'yvan-framework/' \ + --exclude 'yvan-ui/' \ + --exclude 'build.gradle' \ + --exclude 'settings.gradle' \ + --exclude 'application*' \ + --exclude 'bootstrap*' \ + --exclude 'wms-print/' \ + --exclude 'generated/' \ + --exclude 'generated_tests/' \ + --exclude '*.bpmn' \ + --exclude 'wms-modules/yvan-studio/' \ + --exclude 'gradle.properties' \ + --exclude 'gradle-wrapper.properties' \ + --exclude 'Dockerfile*' \ + $source_path/ $target_path + echo -e "$echoPrefix 同步完成 $echoSuffix" + + echo -e "$echoPrefix 开始同步 $source_path/yvan-framework/yvan-studio $echoSuffix" + rsync -azr --progress --delete \ + --exclude '.git/' \ + --exclude '.gradle/' \ + --exclude '.httpCache/' \ + --exclude '.idea/' \ + --exclude 'logs/' \ + --exclude 'build/' \ + --exclude 'out/' \ + --exclude 'libs/' \ + --exclude 'node_modules/' \ + --exclude 'yvan-framework/' \ + --exclude 'yvan-ui/' \ + --exclude 'build.gradle' \ + --exclude 'settings.gradle' \ + --exclude 'application*' \ + --exclude 'bootstrap*' \ + --exclude 'generated/' \ + --exclude 'generated_tests/' \ + --exclude '*.bpmn' \ + --exclude 'gradle.properties' \ + --exclude 'gradle-wrapper.properties' \ + --exclude 'Dockerfile*' \ + $source_path/yvan-framework/yvan-studio $target_path/wms-modules + echo -e "$echoPrefix 同步完成 $echoSuffix" + + echo -e "$echoPrefix 开始同步 lib $echoSuffix" + rsync -azr --progress --include '/yvan-*' --include '/wms-core-*' --include '/wms-api-*' --exclude='*' $source_path/wms-modules/wms-system/build/libs/lib/ $target_path/libs echo -e "$echoPrefix 同步完成 $echoSuffix" } @@ -124,3 +150,6 @@ sync_files # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) + + + From ee0566e261505eb5cb625f0cdc8a541893d2dc05 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 14:53:47 +0800 Subject: [PATCH 15/34] ... --- dsl/001sync_code.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index c5ce383..6db4fc8 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -97,6 +97,7 @@ sync_files() { --exclude 'node_modules/' \ --exclude 'yvan-framework/' \ --exclude 'yvan-ui/' \ + --exclude 'yvan-ui-dist/' \ --exclude 'build.gradle' \ --exclude 'settings.gradle' \ --exclude 'application*' \ From 1958018938b59b1fad41ec1cd30bd8fb263af9c2 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 15:34:36 +0800 Subject: [PATCH 16/34] ... --- dsl/001sync_code.sh | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 6db4fc8..5bd2f43 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -77,12 +77,27 @@ source_build() { echo -e "$echoPrefix gradle build -x test $echoSuffix" gradle build -x test echo "" + + # 构建 yvan-ui + echo -e "$echoPrefix cd $source_path/yvan-ui $echoSuffix" + cd $source_path/yvan-ui + echo -e "$echoPrefix yarn run build_only $echoSuffix" + yarn run build_only } target_pull() { pullCode $target_path ${target_git} ${target_branch} ${target_position} } +target_build() { + # 构建 java + echo -e "$echoPrefix cd $target_path $echoSuffix" + cd $target_path + echo -e "$echoPrefix gradle build -x test $echoSuffix" + gradle build -x test + echo "" +} + sync_files() { echo -e "$echoPrefix 开始同步: $source_path $echoSuffix" rsync -azr --progress --delete \ @@ -140,15 +155,36 @@ sync_files() { echo -e "$echoPrefix 同步完成 $echoSuffix" echo -e "$echoPrefix 开始同步 lib $echoSuffix" - rsync -azr --progress --include '/yvan-*' --include '/wms-core-*' --include '/wms-api-*' --exclude='*' $source_path/wms-modules/wms-system/build/libs/lib/ $target_path/libs + rsync -azr --progress \ + --include '/yvan-*' \ + --include '/wms-core-*' \ + --include '/wms-api-*' \ + --exclude='*' \ + $source_path/wms-modules/wms-system/build/libs/lib/ $target_path/libs + echo -e "$echoPrefix 同步完成 $echoSuffix" + + echo -e "$echoPrefix 开始同步 yvan-ui $echoSuffix" + rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" } +commit_target() { + echo -e "$echoPrefix cd $target_path $echoSuffix" + cd $target_path + echo -e "$echoPrefix git add . $echoSuffix" + git add . + echo -e "$echoPrefix git commit -m '代码同步' $echoSuffix" + git commit -m '代码同步' + echo -e "$echoPrefix git push origin $target_branch $echoSuffix" + git push origin $target_branch +} + source_pull -#source_build +source_build target_pull sync_files - +commit_target +target_build # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From 71d56d1e27f902984300c2efd5a3e8a9bf9c60fb Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 15:36:58 +0800 Subject: [PATCH 17/34] ... --- dsl/001sync_code.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 5bd2f43..37193c8 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -81,6 +81,8 @@ source_build() { # 构建 yvan-ui echo -e "$echoPrefix cd $source_path/yvan-ui $echoSuffix" cd $source_path/yvan-ui + echo -e "$echoPrefix yarn install $echoSuffix" + yarn install echo -e "$echoPrefix yarn run build_only $echoSuffix" yarn run build_only } From b6dd0d6af6e4b09ce7620f6b55e75a144f450d0a Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 16:06:45 +0800 Subject: [PATCH 18/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 37193c8..1cf39a8 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -185,8 +185,8 @@ source_pull source_build target_pull sync_files -commit_target target_build +commit_target # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From aa3747a7fb420d9c912a726773d03fd97dc13c98 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 16:08:20 +0800 Subject: [PATCH 19/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 1cf39a8..d411630 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -182,8 +182,8 @@ commit_target() { } source_pull -source_build target_pull +source_build sync_files target_build commit_target From 08787f96c7b1290aa07e2c694575451002a7dd9e Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 16:14:17 +0800 Subject: [PATCH 20/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index d411630..e6b7607 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -185,7 +185,7 @@ source_pull target_pull source_build sync_files -target_build +#target_build commit_target # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From 1d947e29703622d0d669b707e79ecd2054a6be94 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 16:23:17 +0800 Subject: [PATCH 21/34] ... --- dsl/001sync_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index e6b7607..d411630 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -185,7 +185,7 @@ source_pull target_pull source_build sync_files -#target_build +target_build commit_target # bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/dsl/001sync_code.sh) From bb02503061c62678c179ae7b75c3a5d31061a1bb Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 16:33:26 +0800 Subject: [PATCH 22/34] ... --- dsl/001sync_code.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index d411630..7155421 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -173,8 +173,8 @@ sync_files() { commit_target() { echo -e "$echoPrefix cd $target_path $echoSuffix" cd $target_path - echo -e "$echoPrefix git add . $echoSuffix" - git add . + echo -e "$echoPrefix git add --all . $echoSuffix" + git add --all . echo -e "$echoPrefix git commit -m '代码同步' $echoSuffix" git commit -m '代码同步' echo -e "$echoPrefix git push origin $target_branch $echoSuffix" From 780cc7261085673a156443580fc70309935d2d4d Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 17:01:15 +0800 Subject: [PATCH 23/34] ... --- dsl/001sync_code.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 7155421..8a33b1c 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -142,6 +142,9 @@ sync_files() { --exclude 'libs/' \ --exclude 'node_modules/' \ --exclude 'yvan-framework/' \ + --exclude 'src/main/java/' \ + --exclude 'src/main/resources/' \ + --exclude 'src/test/' \ --exclude 'yvan-ui/' \ --exclude 'build.gradle' \ --exclude 'settings.gradle' \ From 47abbd71eda7a62fd851507938e007b59a0fc460 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 22 Oct 2024 17:02:28 +0800 Subject: [PATCH 24/34] ... --- dsl/001sync_code.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 8a33b1c..7e35a1a 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -187,6 +187,7 @@ commit_target() { source_pull target_pull source_build +target_pull sync_files target_build commit_target From c3e82da15a5295bf2d9fb7e160d464d0bfd4aef9 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Mon, 28 Oct 2024 15:21:22 +0800 Subject: [PATCH 25/34] ... --- hua_wei_yun/12wms86-sd-test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hua_wei_yun/12wms86-sd-test.sh b/hua_wei_yun/12wms86-sd-test.sh index 7e492d8..4a9c12c 100644 --- a/hua_wei_yun/12wms86-sd-test.sh +++ b/hua_wei_yun/12wms86-sd-test.sh @@ -158,6 +158,11 @@ deployPull() { git pull echo "###--代码更新完成--------------------------------------------------------------------------###" echo "" + + version=$(date +_%Y_%m_%d_%H_%M_%S) + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $codePath/wms-ui/index.html $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $codePath/wms-ui/index.html + sed } deployServer() { From 070e743101f2cc4e8c33339f0e708f2e8401bcf1 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Mon, 28 Oct 2024 15:22:17 +0800 Subject: [PATCH 26/34] ... --- hua_wei_yun/12wms86-sd-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hua_wei_yun/12wms86-sd-test.sh b/hua_wei_yun/12wms86-sd-test.sh index 4a9c12c..7162fe1 100644 --- a/hua_wei_yun/12wms86-sd-test.sh +++ b/hua_wei_yun/12wms86-sd-test.sh @@ -156,13 +156,13 @@ deployPull() { cd /home/www/deploy/wms85_sd_test/wms-ui/node_modules/yvan-ui echo -e "$echoPrefix git pull $echoSuffix" git pull - echo "###--代码更新完成--------------------------------------------------------------------------###" - echo "" version=$(date +_%Y_%m_%d_%H_%M_%S) echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $codePath/wms-ui/index.html $echoSuffix" sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $codePath/wms-ui/index.html - sed + + echo "###--代码更新完成--------------------------------------------------------------------------###" + echo "" } deployServer() { From 82d1fc04798cb14fe9c15f0042f9f3dc7a5bf7d2 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 31 Oct 2024 18:09:56 +0800 Subject: [PATCH 27/34] ... --- dsl/001sync_code.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 7e35a1a..59c26bf 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -171,6 +171,16 @@ sync_files() { echo -e "$echoPrefix 开始同步 yvan-ui $echoSuffix" rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" + + echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" + version=$(date +_%Y_%m_%d_%H_%M_%S) + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $$target_path/wms-ui/index.html $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $$target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js + echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" } commit_target() { From 4dc99117a05d9f1a414a2fba047e6ca157d52d65 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Thu, 31 Oct 2024 18:13:22 +0800 Subject: [PATCH 28/34] ... --- dsl/001sync_code.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 59c26bf..1319b36 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -174,8 +174,8 @@ sync_files() { echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" version=$(date +_%Y_%m_%d_%H_%M_%S) - echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $$target_path/wms-ui/index.html $echoSuffix" - sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $$target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" From 7b4dc04eda6a32f39d64c3b9cba409eaf3f44dea Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Fri, 1 Nov 2024 15:16:16 +0800 Subject: [PATCH 29/34] 001sync_code.sh --- dsl/001sync_code.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 1319b36..59b5bf6 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -172,15 +172,15 @@ sync_files() { rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" - echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" - version=$(date +_%Y_%m_%d_%H_%M_%S) - echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" - sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html - echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" - sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html - echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" - sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js - echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" +# echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" +# version=$(date +_%Y_%m_%d_%H_%M_%S) +# echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" +# sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html +# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" +# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html +# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" +# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js +# echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" } commit_target() { From 2c20be2ad9210cd196c00940ddfb489edde295ee Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Mon, 4 Nov 2024 13:40:14 +0800 Subject: [PATCH 30/34] 001sync_code.sh --- dsl/001sync_code.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 59b5bf6..1319b36 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -172,15 +172,15 @@ sync_files() { rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" -# echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" -# version=$(date +_%Y_%m_%d_%H_%M_%S) -# echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" -# sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html -# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" -# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html -# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" -# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js -# echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" + echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" + version=$(date +_%Y_%m_%d_%H_%M_%S) + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js + echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" } commit_target() { From 8d056d01303755b3d04bac97a76cfa439f9a23dd Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Tue, 5 Nov 2024 11:51:25 +0800 Subject: [PATCH 31/34] 001sync_code.sh --- dsl/001sync_code.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 1319b36..59b5bf6 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -172,15 +172,15 @@ sync_files() { rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" - echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" - version=$(date +_%Y_%m_%d_%H_%M_%S) - echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" - sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html - echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" - sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html - echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" - sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js - echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" +# echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" +# version=$(date +_%Y_%m_%d_%H_%M_%S) +# echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" +# sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html +# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" +# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html +# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" +# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js +# echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" } commit_target() { From cb7c893e582cd7dfc3190f0d056acde7095f9f3a Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Fri, 8 Nov 2024 16:38:14 +0800 Subject: [PATCH 32/34] 001sync_code.sh --- dsl/001sync_code.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dsl/001sync_code.sh b/dsl/001sync_code.sh index 59b5bf6..1319b36 100644 --- a/dsl/001sync_code.sh +++ b/dsl/001sync_code.sh @@ -172,15 +172,15 @@ sync_files() { rsync -azr --progress --delete $source_path/yvan-ui/dist/ $target_path/yvan-ui-dist/dist echo -e "$echoPrefix 同步完成 $echoSuffix" -# echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" -# version=$(date +_%Y_%m_%d_%H_%M_%S) -# echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" -# sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html -# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" -# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html -# echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" -# sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js -# echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" + echo -e "$echoPrefix 处理前端资源缓存 $echoSuffix" + version=$(date +_%Y_%m_%d_%H_%M_%S) + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/wms-ui/index.html $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/wms-ui/index.html + echo -e "$echoPrefix sed -i 's|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g' $target_path/yvan-ui-dist/dist/js/*.js $echoSuffix" + sed -i "s|/yvan-ui.mjs|/yvan-ui.mjs?v=$version|g" $target_path/yvan-ui-dist/dist/js/*.js + echo -e "$echoPrefix 处理前端资源缓存-完成 $echoSuffix" } commit_target() { From 4716946fd58101d15ad601aef3b83a20d7432f4b Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Sat, 9 Nov 2024 11:15:02 +0800 Subject: [PATCH 33/34] 19wms-test-zz-d110.sh --- yxt-db-pg/19wms-test-zz-d110.sh | 233 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 yxt-db-pg/19wms-test-zz-d110.sh diff --git a/yxt-db-pg/19wms-test-zz-d110.sh b/yxt-db-pg/19wms-test-zz-d110.sh new file mode 100644 index 0000000..b4022bb --- /dev/null +++ b/yxt-db-pg/19wms-test-zz-d110.sh @@ -0,0 +1,233 @@ +#!/bin/bash +#set -x +set -e + +codePath=/home/www/deploy/wms8_test_zz_d110 +gitUrlArr=( + "http://git.galaxis.yvanui.com/wms8/wms8-bench.git" + "http://git.galaxis.yvanui.com/wms8/wms-core.git" + "http://git.yvanui.com/lizhiwei/yvan-framework.git" +) + +branchArr=( + "pgsql_3" + "pgsql_3" + "pgsql" +) +positionArr=( + "." + "wms-core" + "yvan-framework" +) +# 是否需要构建,-1:自动;0:不需要;1:需要 +needBuild=( +"1" +"1" +"1" +) + +echoPrefix="\033[36m+" +echoSuffix="\033[0m" + + +# 强制覆盖本地的代码 git fetch --all && git reset --hard origin/master +isChange="1" # 仓库是否发生变化,0:未变化;非0:变化 +pullCode() { + # Usage: pullCode "codePath" "gitUrl" "branch" "position" + path=$1 # 代码保存路径 + gitUrl=$2 # git仓库地址 + branch=${3:-"master"} # git分支 + position=${4:-""} # 使用“.”clone到当前文件夹 + isChange="1" + # 创建文件夹 + if [ ! -d "$path" ]; then + echo -e "$echoPrefix 请检查服务器是否正确,再执行: mkdir -p $path $echoSuffix" + exit + fi + + # git clone + echo -e "$echoPrefix cd $path $echoSuffix" + cd $path + if [ "`ls -A $path`" == "" ] || [ ! -d "$path/$position" ] || [ "`ls -A $path/$position`" = "" ]; then + echo -e "$echoPrefix git clone $gitUrl $position $echoSuffix" + git clone $gitUrl $position + isChange="2" + fi + + # 进入文件夹,切换分支,git pull + if [ "$position" != "" ]; then + echo -e "$echoPrefix cd $position $echoSuffix" + cd $position + fi + echo -e "$echoPrefix git checkout $branch $echoSuffix" + git checkout $branch + echo -e "$echoPrefix git checkout . $echoSuffix" + git checkout . + echo -e "$echoPrefix git pull $echoSuffix" + if [ "`git pull`" == "Already up-to-date." ] && [ $isChange == "1" ]; then + isChange="0" + fi + echo "" +} + +buildCode() { + # 构建 wms-biz/bundle + if [ "${needBuild[0]}" != "0" ]; then + echo -e "$echoPrefix cd $codePath/wms-biz/bundle $echoSuffix" + cd "$codePath/wms-biz/bundle" + echo -e "$echoPrefix yarn $echoSuffix" + yarn + echo -e "$echoPrefix yarn link yvan-ext $echoSuffix" + yarn link yvan-ext + echo -e "$echoPrefix yarn build $echoSuffix" + yarn build + echo "" + else + echo "wms-biz/bundle 文件未变化" + fi + + # 构建 wms-biz/pda-client + if [ "${needBuild[0]}" != "0" ]; then + echo -e "$echoPrefix cd $codePath/wms-biz/pda-client $echoSuffix" + cd "$codePath/wms-biz/pda-client" + echo -e "$echoPrefix yarn $echoSuffix" + yarn + echo -e "$echoPrefix yarn link yvan-ext-mobile $echoSuffix" + yarn link yvan-ext-mobile + echo -e "$echoPrefix yarn build $echoSuffix" + yarn build + echo "" + else + echo "wms-biz/pda-client 文件未变化" + fi + + # 构建 java + echo -e "$echoPrefix cd $codePath $echoSuffix" + cd $codePath + echo -e "$echoPrefix gradle build -x test $echoSuffix" + gradle build -x test + echo "" +} + +logPath=/data/logs/wms8_test_zz_d110/wms8_test_zz_d110.log +dirPath=/home/www/deploy/wms8_test_zz_d110/wms-biz/servo/build/libs/ +serverName=wms8_test_zz_d110 + +cmd=$1 +profiles=${2:-"pg-test-d110"} + +#------------------------------------------------------------------- +JAVA_MEM_OPTS=" -DappName=${serverName} -server -Xmx4g -Xms4g" +DATABASE_OPTS=" -Ddatabase.codeset=ISO-8859-1 -Ddatabase.logging=false" +JAVA_OPTS_EXT=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai" +#------------------------------------------------------------------- + +startServer() { + pid=$1 + if [ -z $pid ];then + echo -e "$echoPrefix cd $dirPath../runtime/ $echoSuffix" + cd $dirPath../runtime/ + echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8100 >>/dev/null 2>&1 & $echoSuffix" + java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8100 >>/dev/null 2>&1 & + echo "$serverName 启动成功!" + else + echo "$serverName 正在运行..." + fi + echo "查看日志: tail -F $logPath -n 100" +} + +stopServer() { + pid=$1 + if [ -z $pid ];then + echo "$serverName 未运行" + else + echo -e "$echoPrefix ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print \$2}' | xargs kill $echoSuffix" + ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}' | xargs kill + echo "$serverName 已停止!" + fi +} + +deployPull() { + for ((idx=0; idx<${#gitUrlArr[@]}; idx++)); do + pullCode $codePath ${gitUrlArr[idx]} ${branchArr[idx]} ${positionArr[idx]} + if [ "${needBuild[idx]}" == "-1" ]; then + needBuild[idx]=$isChange + fi + done + # 设置 require_config.js 前端版本 + version=$(date +_%Y_%m_%d_%H_%M_%S) + echo -e "$echoPrefix sed -i 's/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g' $codePath/public/require_config.js $echoSuffix" + sed -i "s/_[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}/$version/g" $codePath/public/require_config.js + echo "###--代码更新完成--------------------------------------------------------------------------###" + echo "" +} + +deployServer() { + pid=$1 + deployPull + buildCode + echo "###--代码构建完成--------------------------------------------------------------------------###" + # 重启服务 + if [ ! -z $pid ];then + stopServer $pid + sleep 3s + fi + # 移动编译后的文件 + echo -e "$echoPrefix cd $dirPath $echoSuffix" + cd $dirPath + echo -e "$echoPrefix rm -rf ../runtime $echoSuffix" + rm -rf ../runtime + echo -e "$echoPrefix cp -r ./ ../runtime $echoSuffix" + cp -r ./ ../runtime + echo "" + startServer +} + +restartServer() { + pid=$1 + if [ ! -z $pid ];then + stopServer $pid + sleep 3s + fi + startServer +} + +logs() { + tail -F $logPath -n 100 +} + +deployYvanUI() { + bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/00base/01yvan-ext.sh) pull + bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/00base/02yvan-ext-mobile.sh) pull +} + +pid=`ps -ef | grep "DappName=${serverName}" | grep -v 'grep' | awk '{print $2}'` +# 操作参数: pull deploy restart start stop kill log logs +if [ "$cmd" == "pull" ];then + deployYvanUI + deployPull + if [ -z $pid ];then + echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs" + fi +elif [ "$cmd" == "deploy" ];then + deployYvanUI + deployServer $pid +elif [ "$cmd" == "restart" ];then + restartServer $pid +elif [ "$cmd" == "start" ];then + startServer $pid +elif [ "$cmd" == "stop" ] || [ "$cmd" == "kill" ];then + stopServer $pid +elif [ "$cmd" == "log" ] || [ "$cmd" == "logs" ];then + logs +else + if [ -z $pid ];then + echo "$serverName 未运行 | 输入操作参数: pull deploy restart start stop kill log logs" + else + echo "输入操作参数: pull deploy restart start stop kill log logs" + echo "pid=$pid | $serverName 正在运行... | 查看日志: tail -F $logPath -n 100" + fi +fi + +# 一心堂 测试 10.0.30.225 +# bash <(curl -s http://git.yvanui.com/lizhiwei/jztd-deploy/raw/master/yxt-db-pg/19wms-test-zz-d110.sh) [cmd profiles] From 1a12d1730db079600726f317721d287fff88de68 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Sat, 9 Nov 2024 11:34:44 +0800 Subject: [PATCH 34/34] 19wms-test-zz-d110.sh --- yxt-db-pg/19wms-test-zz-d110.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yxt-db-pg/19wms-test-zz-d110.sh b/yxt-db-pg/19wms-test-zz-d110.sh index b4022bb..6cb9127 100644 --- a/yxt-db-pg/19wms-test-zz-d110.sh +++ b/yxt-db-pg/19wms-test-zz-d110.sh @@ -127,8 +127,8 @@ startServer() { if [ -z $pid ];then echo -e "$echoPrefix cd $dirPath../runtime/ $echoSuffix" cd $dirPath../runtime/ - echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8100 >>/dev/null 2>&1 & $echoSuffix" - java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8100 >>/dev/null 2>&1 & + echo -e "$echoPrefix java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8110 >>/dev/null 2>&1 & $echoSuffix" + java $JAVA_MEM_OPTS $DATABASE_OPTS $JAVA_OPTS_EXT -jar ./servo-0.0.0-SNAPSHOT.jar --spring.profiles.active=global,$profiles --server.port=8110 >>/dev/null 2>&1 & echo "$serverName 启动成功!" else echo "$serverName 正在运行..."