最近项目组使用Jenkins工具,尝试敏捷开发。过程中需要配置自动部署weblogic项目,配置脚本重启weblogic:
function weblogic_start()
{
echo "${GC}Clean cache ......$EC"
rm -rf $domainDir/servers/${serviceName}/tmp/_WL_user/*
echo "${GC}Clean successful ......$EC"
echo "${GC}Start Server ......$EC"
nohup $domainDir/bin/startManagedWebLogic.sh ${serviceName} $wlUrl > $domainDir/bin/${serviceName}.log &
sleep 30
cat $domainDir/bin/${serviceName}.log|grep "<Server state changed to"
cat $domainDir/bin/${serviceName}.log|grep -q "<Server state changed to RUNNING>"
if [ $? -eq 0 ];then
echo "${GC}${serviceName} is successful RUNNING $EC"
else
sleep 30
cat $domainDir/bin/${serviceName}.log|grep "<Server state changed to"
cat $domainDir