zoukankan      html  css  js  c++  java
  • tomcat war包自动化部署脚本

     1 #/bin/bash
     2 
     3 #带发布build的war包名称
     4 war_name="weiFeng.war"
     5 war_dir="/home/deploy/wei_feng_targets/dev"
     6 code_dir="/home/deploy/wei_feng_targets/dev/deploy_files"
     7 tomcat_dir="/home/deploy/tomcat/tomcat-7.0.75-wei-feng-8081-8082"
     8 current_env="wei-feng-dev"
     9 
    10 
    11 # kill tomcat进程
    12 tomcat_pid=`cat $tomcat_dir/bin/tomcat_pid`
    13 
    14       kill -9 $tomcat_pid
    15       if [ $? -ne 0 ];then 
    16                echo -e "33[31m33[01m [   old tomcat kill failed  ]33[0m"
    17       else 
    18              echo -e "33[32m[  kill old tomcat success with pid: $tomcat_pid ]33[0m"
    19       fi
    20 
    21 rm -rf $code_dir/*
    22 echo "delete last $war_name  project files $code_dir"
    23 
    24 
    25  #解压war包到 代码执行地方
    26 cd $war_dir
    27 echo "unzip $war_name to $code_dir"
    28 unzip -oq $war_name -d $code_dir/
    29 
    30 
    31 #重启tomcat
    32 cd $tomcat_dir/bin
    33 sh startup.sh
    34 
    35 sleep 5
    36 tomcatport=`sudo netstat -lntp|grep "8081"|awk '{print $4}'|awk -F":" '{print $2}'`
    37 echo $tomcatport
    38 
    39 if [ "$tomcatport" ];then
    40           echo -e "33[32m[ tomcat started success on $current_env !  ]33[0m"
    41 fi
  • 相关阅读:
    vue中的具名插槽
    vue中默认插槽slot
    局部组件使用指令-方法-过滤器-计算属性
    vue创建局部组件
    Class Metaprogramming
    Attribute Descriptors
    Dynamic Attributes and Properties
    Concurrency with asyncio
    Concurrency with Futures
    Coroutines
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/9200861.html
Copyright © 2011-2022 走看看