[原]jenkins(六)---jenkins远程部署脚本

时间:2023-02-11 15:18:44

/**

* lihaibo

* 文章内容都是根据自己工作情况实践得出。

* 版权声明:本博客欢迎转发,但请保留原作者信息!

http://www.cnblogs.com/horizonli/p/5332551.html

*/

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1UAAAGaCAIAAABovP7ZAAAgAElEQVR4nO3dbZAbx33n8X3HSJTk6JGy41QUJ2XTqXKcClAx7cTJXaxUyS7Ft3ZSvivYieNDmNAlXe5JTor3ApeSy1FiHeTcxecHiUpgXoqkaSpSZCEuU5QUUBSfBMrWUNz1Lh8g0oAoUVray6wkZEkC92IwM93T3fMADBYzO99PbdnAPPT0DIaaX/17BpjqAwAAIE+mJt0BAAAArCjyHwAAQL6Q/wAAAPKF/AcAAJAv5D8AAIB8iZf/er3ec987HPwCAAAAaRYv/x1+dv8j/7gr+AUAAADSbIXHfxuVgqvSSKDBVq2kb8qeUSgUSrWGsIxxeWRN2j7KgHNbO6tRkRZM2+4AAFazlRz/Fa9wjUqhUCjVWsP1Wt+mSGy/ldP816qVVvOOpuqjDDi3TbPIfwCAiVnJ8V/fBS8RUfJflOVXndW/o6naw4Bz2zSL/AcAmJiVHP+1R8G0VzhhgMwLbYMMV3Pm+a+VhUKhUtNdNd3ZdnMB9T/tdoXV9RVKsX25qVKppN9H3YYGzYgdc+dpO6bdsrbSqS5naDB0t7RTB9upubMqDa/9wUJRlvE179v9GB/9MB+ZnL/EdwFnY/DnG3BuG1Yh/wEAJmFln/91L6zSRVoZFBNfD94YlpEilLKlkPFffZu+DKU0LV7Oldb06cO0g17ok7cVeED8fTfsqdSisQP+TmobV3dWPOyD1+LnEXkZNXUN9dEP+ZEpG/emhpyNOvpzO2CWeFOgP5sCADBWE3j+118FkgNJq1bSXfj9l205QQ2V/wzbNUZKteG+KYcFrSLsYF+qS/kqiery+oHECPkvqANSM/7GTTtrDJdRAqj6kRmqlZE/+pE+Ml8UjHQ2GukqnKZZ1P8AABMzqe9/9o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593dnC5V7eiqH4Je2jrm9qONFu139w9LvZqpWEgphvRf/ymk0a85/6oWj21zT+K/RK0w3jgKQu/3lhXcpD2o/DfxbFyX/SwdcX5Bqmxt3jYz5iyj6Hbc6741M+y+VPbZj8F+1Aed2M8G9zwE4bJ3dsGdSr3EKUMGQpLWPMOk5wObP3drGa1e/3+5Had9p0C2NC/W/Hub5vAPqZh/WNSNlLilxR++Af//X1SmxncFicPTUu0z+z9y73aNg9F9Ot2ivlAGYF+Q/IIPkCoZQNRq7/+a5VQTc4+fOfpvZkuvi51UBDpSxK/tP1Td1FuSVfu8LlW2mqVSuVag3NvvW1t+iPXP+Llv/kXqlb8PVTyRdR8l9Ax72X3oYGFVZpNW2MsVdRVxy2/mfMf6GbE4a5vW76K9S6/Gfc5cD6nyH/Rfm36VShvNqbP23o8p9QnTLnP3d1MUhFaL9vJ7x7H/bFKS9gaet/kfNftD5o7v8TeyWkPa/+Z+ywWP8TxqB99T99zvMdwIwg/wGZoxtCEoOU7sLrvyFJm/+UOo94ZfOPQcprNcQBLqdmVKmUtBc/tzXf1c63lUj5T9M3dVapVFK3KxxO4QIsNOUV2dxXQlVsEEikTWtuWVNzovEuMX3+K0hKtYbaK/XT8fXT/xFHyX+6ZpWzyN2O+ySSt7++8p988JUV1UOnOZgBR8x/nMM3596Q55w0/nf+f1NuLdG0y8ZPNij/Rfm36RSZxETlVqG00UoeMzXmP7cd0/1/pvadXrkhUo1T2vvqIue/SH2YuUu4X1A4VmIPB4W9u+4d3BDpr/8py0g3Gprv/7N7ZTqAmUD+A5BzvqCSipayL+axUBfnYALjRP4DkHtJff8fkcUV90tRyH9m4j1n/KX2b9KnSWzkPwAAgHwh/wEAAOQL+Q8AACBfyH8AAAD5Qv4DAADIF/IfAADIl2PHjjXzZGZmxncEyH8AACBfms3mi3nSbDZ9R4D8BwAA8oX8R/4DAAD5Qv77/5FkdwsexTfEAAAAAElFTkSuQmCC" alt="" width="740" height="356" />

在远程主机上创建一个shell脚本放置在自定义路径中:这里我放置在/opt下面:取名叫auto_deploy.sh

即:auto_deploy.sh在远程主机上什么位置,上图中的 Exec command 中就要写到哪个位置。

shell脚本怎么写可以自己定义:这里分享下自己写的脚本,以供参考:

#!/bin/bash
#Time
log_time=`date +[%Y-%m-%d]%H:%M:%S` ###manual_properties###
tomcat_basehome=/opt/tomcat6/apache-tomcat-6.0.
tomcat_port=
shell_environment=/bin/bash
war_Dir=/opt/jenkins
war_Name=quick4j.war
###manual_properties### #update server environment
echo "********************************** ${log_time} *************************************"
echo "updating server environment start"
export JAVA_HOME=/app/java/jdk1..0_11
export JRE_HOME=/app/java/jdk1..0_11/jre
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar/
export CATALINA_2_HOME=/opt/tomcat6/apache-tomcat-6.0.
export CATALINA_2_BASE=/opt/tomcat6/apache-tomcat-6.0.
export TOMCAT_2_HOME=/opt/tomcat6/apache-tomcat-6.0.
sleep
echo "updating server environment end" #build check funcation
echo "check tomcat status..."
check_tomcat_status(){
netstat -ant|grep ${tomcat_port} > /dev/null
t=$?
if [ $t -eq ]; then
echo "tomcat is running....port is ${tomcat_port}"
echo "shutdown tomcat....."
echo ">>>>>>>shutdown tomcat begin<<<<<<<<"
${shell_environment} ${tomcat_basehome}/bin/shutdown.sh
echo ">>>>>>>shutdown tomcat end <<<<<<<<"
sleep
elif [ $t -ne ];then
echo "tomcat is poweroff"
${shell_environment} ${tomcat_basehome}/bin/shutdown.sh
sleep
fi
} #check tomcat status invoke function
check_tomcat_status #transfer application package
deploy_Loaction=${tomcat_basehome}/webapps/
war_Dir_Data=`ls ${war_Dir}`
echo "-------------- begin transfer war package to tomcat webapps -------------------" if [ -z $war_Dir ];then
echo "Folder ${war_Dir} is empty.please check war package in this folder!"
exit
else
echo "Find ${war_Dir} exist war package ${war_Name}"
# echo "deleteing old package ${war_Name} in ${war_Dir}"
# rm ${war_Dir}/${war_Name}
echo "deleteing old package ${war_Name} in ${deploy_Loaction}"
rm ${deploy_Loaction}${war_Name}
echo "start transfer ${war_Name} to ${deploy_Loaction}"
cp ${war_Dir}/${war_Name} ${deploy_Loaction}
sleep
fi
echo "-------------- transfer war package to tomcat webapps end -------------------"
#reboot tomcat
echo " >>>>>>> rebooting tomcat begin <<<<<<<<"
${shell_environment} ${tomcat_basehome}/bin/startup.sh
echo " >>>>>>> rebooting tomcat end <<<<<<<<"
echo "the log you can read in canalina.out"
echo "************************ deploy war package into container Successlly **********************************"

--------------------目录电梯---------------------

[原]Jenkins(一)---我理解的jenkins是这样的

[原]Jenkins(二)---jenkins之Git+maven+jdk+tomcat

[原]Jenkins(三)---Jenkins初始配置和插件配置

[原]Jenkins(四)---Jenkins添加密钥对

[原]jenkins(五)---jenkins添加项目

[原]jenkins(六)---jenkins远程部署脚本

[原]Jenkins(七)---jenkins项目编译测试发布由maven构建的web项目

[原]Jenkins(八)---jenkins构建项目报错时发送错误报告邮件

[原]Jenkins(九)---jenkins分别发布多个项目到多个远程主机

[原]Jenkins(十)---jenkins注册管理员admin并赋所有权限给admin

[原]Jenkins(十一)---jenkins使用管理员admin创建用户和分配权限

[原]Jenkins(十二)---jenkins管理员用户无法登陆解决办法Access Denied

[原]Jenkins(十三)---jenkins用户权限管理

[原]Jenkins(十四)---jenkins示例:admin管理所有项目,新建用户只能看部分项目

[原]Jenkins(十五)---jenkins插件之deploy