jenkins的具体配置:
1、general
1)项目名称:location
2)描述:
×××务运营平台
/tomcat/tomcat_location/upload/
/tomcat/tomcat_location/bin/
./startup.sh
2、源码管理
1)respository url:http://10.99.99.99/svn/ODS/LBIP/trunk
3、构建触发器
4、构建环境
5、构建
1)command
echo build phase 1 ${PWD}
echo ${CLASSPATH}
cp /home/zr/location/build.xml ${WORKSPACE}
rm -f ${WORKSPACE}/WebRoot/WEB-INF/lib/wstx-asl-3.2.0.jar
6、构建后操作
1)command
cd /tomcat/tomcat_location/upload/
./getwar
./ndeploy
Getwar:
ftp -niv <<!
open 10.99.99.99
user weblogic web123
binary
cd /var/lib/jenkins/workspace/location/build/
lcd /tomcat/tomcat_location/upload/
prompt
get ChannelWeb.war
bye
逻辑:
通过FTP的方式,从10.99.99.99的
/var/lib/jenkins/workspace/location/build/
中获取ChannelWeb.war文件,并将文件放到
/tomcat/tomcat_location/upload/
ndeploy:
cd /tomcat/tomcat_location/webapps/
cp ChannelWeb.war /tomcat/tomcat_location/upload/ChannelWeb.bak
cd /tomcat/tomcat_location/bin/
./shutdown.sh
cd /tomcat/tomcat_location/work/Catalina/localhost/
rm -rf *
cd /tomcat/tomcat_location/webapps/
rm -rf *
cd /tomcat/tomcat_location/upload/
cp ChannelWeb.war /tomcat/tomcat_location/webapps
cd /tomcat/tomcat_location/bin/
./startup.sh
逻辑:
备份原来的war包
停止服务
删除旧的war包与文件
删除tomcat缓存
获取war包到webapps目录下
启动服务
最后将这2个文件放在
/tomcat/tomcat_location/upload/
目录下,并给其赋予读写(rwx)权限。