xinwei #54
29
.drone.yml
29
.drone.yml
@ -161,7 +161,36 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
|
|||||||
- cd /ludu/maven/build/ludu-job-admin/
|
- cd /ludu/maven/build/ludu-job-admin/
|
||||||
- chmod +x ./run.sh # 更改为可执行脚本
|
- chmod +x ./run.sh # 更改为可执行脚本
|
||||||
- ./run.sh || echo "ludu-job-admin build failed" # 运行脚本打包应用镜像并运行
|
- ./run.sh || echo "ludu-job-admin 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
|
||||||
|
rm -f ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/nacos/config/BeanInit.java
|
||||||
|
/root/apache-maven-3.9.4/bin/mvn clean 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 -Xms512m -Xmx512m -jar ludu-module-datacenter/ludu-module-datacenter-biz/target/ludu-module-datacenter-biz.jar --spring.profiles.active=dev > api.log &
|
||||||
volumes: # 定义流水线挂载目录,用于共享数据
|
volumes: # 定义流水线挂载目录,用于共享数据
|
||||||
|
|
||||||
- name: maven-build
|
- name: maven-build
|
||||||
|
Loading…
Reference in New Issue
Block a user