`
jerome_wang
  • 浏览: 158802 次
  • 性别: Icon_minigender_1
  • 来自: 云南
社区版块
存档分类
最新评论

Linux 下 实现GlassfishV3 自动部署

 
阅读更多

Deploy.sh 代码

#. `dirname "$0"`/setenv_1.sh
CheckProcess() 

  if [ "$1" = "" ]; 
  then 
    return 1 
  fi 
  PROCESS_NUM='ps -ef |  grep "$1" | grep -v "grep" | wc -l' 
  if [ $PROCESS_NUM -eq 1 ]; 
  then 
    return 0 
  else 
    return 1 
  fi 

#while [ 1 ] ; do 
 #process name 
 CheckProcess "glassfish"
 Check_RET=$? 
 if [ $Check_RET -eq 1 ]; 
 then 
    sh /home/glassfish3/glassfish/bin/asadmin start-domain domain1 
 fi 
 #sleep

sh /installant/apache-ant-1.8.0/bin/ant -f deploy.xml deploy

 

deploy.xml 代码

<!-- create by cheping.wang 2014.04.25 -->
<project default="installv10">
    <property file="../../installserver/install.properties"/>
<target name="deploy" depends="deployGlassfish">
    </target>           
<target name="deployGlassfish">   
     
        <!--undeploy xx-->       
        <exec dir="." executable="sh">
              <arg line="${GLASSFISHBINHOME}/asadmin" />
              <arg line="--user" />
              <arg line="admin" />
              <arg line="--passwordfile" />
              <arg line="${GLASSFISHBINHOME}/password.txt" />
              <arg line="undeploy" />
              <arg line="xx" />
        </exec>       
 
     
      <!-- deploy xx war  -->
 
        <exec dir="." executable="sh">
              <arg line="${GLASSFISHBINHOME}/asadmin" />
              <arg line="--user" />
              <arg line="admin" />
              <arg line="--passwordfile" />
              <arg line="${GLASSFISHBINHOME}/password.txt" />
              <arg line="deploy" />
              <arg line="${REPORT_HOME}/bin/distribute/${earName}" />
        </exec>


        <!-- start firefox and visit xxhomePage -->
        </target>
        </project>

 

password.txt 内容

AS_ADMIN_PASSWORD=admin

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics