deploy war to weblogic via script(shell)

deploy-uat-war-input.war

 

#!/bin/sh

DOMAIN_HOME=/u01/Oracle...../bin
WLS_LIB=/u01/Oracle/Middleware_.../wlserver/server/lib

read -p “Enter Target war file name(s):” app
DEPLOY_SRC=$app

#weblogic config
ADMINURL=t3://192.168.237.66:7001
USERNAME=weblogicuser
PASSWD=weblogicuser123
TARGET=itappau01_7511,itappau02_7511,itappau01_7509,itappau02_7509

 

for f in $DEPLOY_SRC
do
    echo “$f”
    name=“${f%.*}”
    name=$(echo “$name” | grep -oP -m 1  ‘(.+?(?=-[0-9.]+))|(.+[a-z])’ | head -1)
    echo “Try to undeploy — $name”
    java -cp .:$CLASSPATH:$WLS_LIB/weblogic.jar weblogic.Deployer -adminurl $ADMINURL -username $USERNAME -password $PASSWD -name $name -undeploy -targets $TARGET
      echo “Try to deploy — $name”
    java -cp .:$CLASSPATH:$WLS_LIB/weblogic.jar weblogic.Deployer -adminurl $ADMINURL -username $USERNAME -password $PASSWD -name $name -deploy -upload $f -targets $TARGET

done

 

 

posted @ 2019-10-21 18:52  m.z  阅读(94)  评论(0编辑  收藏