java/nekurak.net-ws/nbproject/wsit-deploy.xml
author František Kučera <franta-hg@frantovo.cz>
Sat Jun 19 11:19:27 2010 +0200 (2010-06-19)
changeset 142 44ef544460ca
permissions -rw-r--r--
AJAX komentáře
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project default="-post-run-deploy" basedir=".." xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1" xmlns:webproject1="http://www.netbeans.org/ns/web-project/1">
     3     <target name="-wsit-init">
     4         <property file="nbproject/private/private.properties"/>
     5         <condition property="user.properties.file" value="${netbeans.user}/build.properties">
     6             <not>
     7                 <isset property="user.properties.file"/>
     8             </not>
     9         </condition>
    10         <property file="${deploy.ant.properties.file}"/>
    11         <condition property="appserver.root" value="${sjsas.root}">
    12             <isset property="sjsas.root"/>
    13         </condition>
    14         <condition property="appserver.password" value="${sjsas.password}">
    15             <isset property="sjsas.password"/>
    16         </condition>
    17         <condition property="appserver.root" value="${gfv3.root}">
    18             <isset property="gfv3.root"/>
    19         </condition>
    20         <condition property="appserver.password" value="${gfv3.password}">
    21             <isset property="gfv3.password"/>
    22         </condition>
    23         <condition property="appserver.password" value="changeit">
    24             <not>
    25                 <isset property="appserver.password"/>
    26             </not>
    27         </condition>
    28         <fail unless="user.properties.file">Must set user properties file</fail>
    29         <fail unless="appserver.root">Must set Sun app server root</fail>
    30         <fail unless="appserver.password">Must set Sun app server password</fail>
    31     </target>
    32     <target name="-create-wsit-prop" unless="do.not.create.wsit.prop">
    33         <echo file="nbproject/wsit.properties" message="AS_ADMIN_USERPASSWORD=${appserver.password}"/>
    34     </target>
    35     <target name="-delete-create-wsit-file" if="user.created">
    36         <delete file="nbproject/wsit.createuser"/>
    37     </target>
    38     <target name="create-user" unless="user.exists">
    39         <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
    40             <arg value="create-file-user"/>
    41             <arg value="--passwordfile"/>
    42             <arg value="nbproject/wsit.properties"/>
    43             <arg value="wsitUser"/>
    44         </exec>
    45         <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
    46             <arg value="create-file-user"/>
    47             <arg value="--passwordfile"/>
    48             <arg value="nbproject/wsit.properties"/>
    49             <arg value="wsitUser"/>
    50         </exec>
    51         <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
    52             <arg value="create-file-user"/>
    53             <arg value="--passwordfile"/>
    54             <arg value="nbproject/wsit.properties"/>
    55             <arg value="wsitUser"/>
    56         </exec>
    57         <condition property="user.created">
    58             <and>
    59                 <contains string="${creation.out}" substring="create-file-user"/>
    60                 <contains string="${creation.out}" substring="success"/>
    61             </and>
    62         </condition>
    63         <antcall target="-delete-create-wsit-file"/>
    64     </target>
    65     <target name="-do-create-user" if="do-create-user">
    66         <available property="do.not.create.wsit.prop" file="nbproject/wsit.properties"/>
    67         <antcall target="-create-wsit-prop"/>
    68         <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
    69             <arg value="list-file-users"/>
    70         </exec>
    71         <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
    72             <arg value="list-file-users"/>
    73         </exec>
    74         <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
    75             <arg value="list-file-users"/>
    76         </exec>
    77         <condition property="user.exists">
    78             <contains string="${as.users}" substring="wsitUser"/>
    79         </condition>
    80         <antcall target="create-user"/>
    81     </target>
    82     <target name="-post-run-deploy" depends="-wsit-init">
    83         <available property="do-create-user" file="nbproject/wsit.createuser"/>
    84         <antcall target="-do-create-user"/>
    85     </target>
    86 </project>