首页 > Web开发 > 详细

weblogic部署脚本

时间:2016-07-13 20:27:26      阅读:257      评论:0      收藏:0      [点我收藏+]
#!/bin/bash
#date 2016-07-12
#writen lxh

dir_war=/home/weblogic/war
dir_app=/servyouapp/weblogic/user_projects/domains/shyznwgl_domain/app
dir_bak=/home/weblogic/backup

dir_restart=/servyouapp/weblogic/user_projects/scripts

deal()
{
    echo -e "\033[33m-----------------------${i}------------------------------\033[0m"
    echo "[INFO] 部署${i}..."
    echo "[INFO] 备份${i}..."
    [ -f $dir_bak/${i}.03 ]&&rm -f $dir_bak/${i}.03
    [ -f $dir_bak/${i}.02 ]&&mv $dir_bak/${i}.02 $dir_bak/${i}.03
    [ -f $dir_bak/${i}.01 ]&&mv $dir_bak/${i}.01 $dir_bak/${i}.02
    [ -f $dir_app/${i} ]&&mv $dir_app/$i $dir_bak/${i}.01
    mv $dir_war/$i $dir_app/
    echo "[START...] ${i}重启中..."
    
    sed -i s/tail/#tail/g $dir_restart/$1
    sh $dir_restart/$1
    sed -i s/#tail/tail/g $dir_restart/$1
    echo ""
}

echo "检查是否有war包更新..."
n1=`ls $dir_war |wc -l`
if [ $n1 -eq 0 ];then
    echo -e "\033[31m[WRING...] ${dir_war}中无war包!\033[0m"
    exit;
fi

echo "war包识别..."
for i in `ls $dir_war`;do
    case $i in
        dzswj-authentication-platform.war)
            deal reshtyrzyz-nw.sh
            ;;
        dzswj-user-manager-platform.war)
            deal reshmhyz-nw.sh
            ;;
        fcsyy-app-nw-web.war)
            deal reshfcsyz-nw.sh
            ;;
        nsqd-nw-web.war)
            deal reshwszyz-nw.sh
            ;;
        nsqd-nw-ws.war)
            deal reshwszyz-nw.sh
            ;;
        wsjs-app-nw-web.war)
            deal reshwsjsyz-nw.sh
            ;;
        wssb-app-nw-web.war)
            deal reshwssbyz-nw.sh
            ;;
        wsz-nw-web.war)
            deal reshxwszyz-nw.sh
            ;;
        *)
            echo -e "\033[31m[WRING...] ${i}包名不匹配,请检查!\033[0m" >>deploy.tmp
            ;;
    esac
done
[ -f deploy.tmp ]&&cat deploy.tmp
[ -f deploy.tmp ]&&rm -f deploy.tmp
echo -e "\033[32m部署完成!请查看相应启动日志。\033[0m"

 

weblogic部署脚本

原文:http://www.cnblogs.com/rohero/p/5667164.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!