Tag:conf start failure Path kill jar web automation history webapps
#!/bin/bash### #just for autodeploy## #author: zgniu######## #定义项目路径 ######## #item_war_dir = "/home/v2/tomcat8080/ Webapps/server-mobile-web "######## #定义项目配置文件路径 ######## #item_conf_dir ="/home/v2/tomcat8080/webapps/ Server-mobile-web/web-inf/classes "######## #定义历史配置文件路径 ######## #history_conf_dir ="/home/backupfile/ Server-mobile-web "######## #定义tomcat启动路径 ######## #tomcat_bin_dir ="/home/v2/tomcat8080/bin "######## #定义项目名称 ####### # #item_name = "Server-mobile-web.war" ######## #定义进程名称 ######## #instance_name = "tomcat8080" ######## #项目地址 ######### Item_url= "http://localhost:8080" ######## #项目日志路径 ######## #item_log_dir = "/home/v2/tomcat8080/logs" ######### Define project backup specific time to seconds ######## #datetime = ' Date +%y-%m-%d ' ######## #开始kkill tomcat process ######## #ps aux | grep ${instance_name} | Grep-v grep | awk ' {print ' kill-9 ", $2|" Bash "} ' ######## #检查进程是否存在 #########" flageid=$ (ps aux | grep $instance _name | grep-v grep) ######## #不存在执行如下操作 ######### "if [["$FLAGEID" = = ""]];then # CD ${item_war_dir} # JAR-XVF ${item_name} #sleep 6 Cp-rF ${history_conf_dir}_backup${datetime}/web-inf/classes/* ${item_conf_dir}sleep 3 CD ${tomcat_bin_dir}./st artup.sh######## #否则再次执行kill进程 ######### "elseps aux | grep ${instance_name} | Grep-v grep | awk ' {print ' kill-9 ", $2|" Bash "} ' fisleep 5######## #检查是否启动成功 #########" CD ${item_log_dir}tail-f catalina-20${datetime}.out ########### #curl ${ item_url}## #if [$?-eq 0]; then###### echo-e "\n################################# #恭喜你, Project startup Success ##################################\n" # # # # # # # # #else # ##### echo-e "\n########################### #很遗憾, Project failed to start, please check ############################\n manually" fi###############
A shell script for an automated deployment