有时候利用tomcat命令无法结束tomcat进程 ,对于jenkins自动发布很不方便, 可以采用下面方法配置tomcat
-
tomcat_path/bin
目录下新建文件tomcat_pid.pid
-
tomcat_path/bin
目录下新建文件setenv.sh
,写入以下内容
CATALINA_PID="/tomcat_path/bin/tomcat_pid.pid"
export CATALINA_PID
- 在jenkins中配置
export BUILD_ID=tomcat_1
#!/bin/bash
cd /tomcat_path/bin
if [ -f tomcat_pid.pid ]; then
echo "tomcat is running, will be killed"
./catalina.sh stop -force
fi
# todo....
/tomcat_path/bin/./startup.sh
网友评论