From 2a03ace3a8f80fe010388a1f497fbbedad3a5189 Mon Sep 17 00:00:00 2001 From: sige Date: Wed, 13 Dec 2023 15:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=91=E5=B8=83=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 9 ++++++++- publish.ps1 | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 publish.ps1 diff --git a/pom.xml b/pom.xml index 21e1176..8bb22f0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 4.0.0 com.dreamworks boditech - 0.0.1-SNAPSHOT + 0.0.12 boditech boditech @@ -59,6 +59,13 @@ org.springframework.boot spring-boot-maven-plugin + + org.codehaus.mojo + versions-maven-plugin + + false + + diff --git a/publish.ps1 b/publish.ps1 new file mode 100644 index 0000000..980d4c5 --- /dev/null +++ b/publish.ps1 @@ -0,0 +1,19 @@ +# update version in pom.xml +$pomData = [xml](Get-Content pom.xml) +$version = $pomData.project.version -split '\.' +$version[2] = [int]$version[2] + 1 +$version = $version -join '.' +mvn versions:set -DnewVersion="$version" + +# build +mvn clean package + +# upload +scp target/boditech-$version.jar root@192.168.8.10:/app-java/ + +# start +ssh root@192.168.8.10 "killall java" +ssh root@192.168.8.10 "rm /app-java/boditech.jar" +ssh root@192.168.8.10 "ln -s /app-java/boditech-$version.jar /app-java/boditech.jar" +ssh root@192.168.8.10 "nohup /app-java/jdk-18.0.2.1/bin/java -jar /app-java/boditech.jar > /app-java/app.log 2>&1 &" +ssh root@192.168.8.10 "tail -f /app-java/app.log" \ No newline at end of file