对于男人的甜言蜜语,你相信三分之一就好了——莫泊桑

新建仓库:

image-20221123111807828

新建完成后测试一下重启是否会丢数据(因为我看到默认用的h2)

1
2
3
4
ps -ef | grep java
kill -9 [jpom对应的pid]
// 默认安装目录在 /usr/local/jpom-server
/usr/local/jpom-server/Server.sh start

重启完成发现并没有丢失

image-20221123113007143

然后配置自动构建

image-20221123114105995

填入信息

构建命令

1
cd ./management && mvn -e -U -DskipTests=true -Ptest clean kotlin:compile package

发布命令

1
2
3
4
5
ps -ef | grep management | awk '{print $2}' | xargs kill -9 || true
mv './target/management.jar' '/test/management.jar'
rm -rf '/test/management-log.txt' || true
touch '/test/management-log.txt'
nohup sh /test/manage.sh

manage.sh

1
2
3
4
5
6
7
8
#!/bin/bash
BUILD_ID=DONTKILLME
function start(){
nohup java -jar '/test/management.jar' > '/test/management-log.txt' 2>&1 &
sleep 5s
exit
}
start