jenkins Send files or execute commands over SSH
Send files or execute commands over SSH1、将war包发送到目标服务器,并执行shell脚本(前提是自动打包成功后)2、利用shell脚本 控制tomcat启停 和 项目部署#export JAVA_HOME=/usr/local/jdk1.6.0_45export DEPLOYMENT_HOME=//usr/local/jenk
·
Send files or execute commands over SSH
1、将war包发送到目标服务器,并执行shell脚本(前提是自动打包成功后)
2、利用shell脚本 控制tomcat启停 和 项目部署
#export JAVA_HOME=/usr/local/jdk1.6.0_45
export DEPLOYMENT_HOME=//usr/local/jenkins-deploy/target
export USERPORTAL_HOME=/usr/local/apache-tomcat-7.0.78-hangye
echo "[Deploy] Shutting down hangye tomcat 1"
if [ `ps auxwwww|grep apache-tomcat-7.0.78-hangye|grep -v grep|wc -l` -gt 0 ]
then
for pid in `ps auxwww|grep apache-tomcat-7.0.78-hangye|grep -v grep|tr -s ' '|cut -d ' ' -f2`
do
kill -9 $pid 2>&1 > /dev/null
done
fi
echo "[Deploy] Cleaning cache for hangye tomcat 1"
rm -rf $USERPORTAL_HOME/work/Catalina/localhost/*
echo "[Deploy] Removing old war"
rm -rf $USERPORTAL_HOME/webapps/hangye*
echo "[Deploy] Copying new war"
mv $DEPLOYMENT_HOME/jeecg.war $USERPORTAL_HOME/webapps/hangye.war
echo "[Deploy] Starting up hangye tomcat 1"
$USERPORTAL_HOME/bin/startup.sh
更多推荐
已为社区贡献3条内容
所有评论(0)