构建脚本更新

This commit is contained in:
XinWei 2024-08-27 17:24:23 +08:00
parent c63516102e
commit 7357b9710b

View File

@ -52,7 +52,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
- scp -r /ludu/maven/build/ludu-module-datacenter root@120.46.37.243:/ludu/maven/build
- echo "datacenter done"
- name: build-other-service
- name: build-old-service
image: appleboy/drone-ssh # SSH工具镜像
@ -76,6 +76,37 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
- chmod +x ./run.sh # 更改为可执行脚本
- ./run.sh || echo "ludu-module-datacenter build failed" # 运行脚本打包应用镜像并运行
- name: build-new-service
image: appleboy/drone-ssh # SSH工具镜像
settings:
host: 121.36.203.133 # 远程连接地址
username: root # 远程连接账号
password:
from_secret: ssh_password3 # 从Secret中读取SSH密码
port: 22 # 远程连接端口
command_timeout: 10m # 远程执行命令超时时间
script:
- cd /root/ludu-cloud
- git pull origin master
- mvn package -Dmaven.test.skip=true
- port=48092 # 指定端口号
- pid=$(lsof -t -i:$port) # 获取占用指定端口的进程号
- if [ -n "$pid" ]; then # 如果进程号不为>>空,则杀死进程
echo "Killing process $pid"
kill -9 $pid
fi
- nohup java -Xms256m -Xms256m -jar ludu-module-datacenter/ludu-module-datacenter-biz/target/ludu-module-datacenter-biz.jar > api.log &
volumes: # 定义流水线挂载目录,用于共享数据
- name: maven-build