java/nekurak.net-ws/nbproject/wsit-deploy.xml
changeset 142 44ef544460ca
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/nekurak.net-ws/nbproject/wsit-deploy.xml	Sat Jun 19 11:19:27 2010 +0200
     1.3 @@ -0,0 +1,86 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<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">
     1.6 +    <target name="-wsit-init">
     1.7 +        <property file="nbproject/private/private.properties"/>
     1.8 +        <condition property="user.properties.file" value="${netbeans.user}/build.properties">
     1.9 +            <not>
    1.10 +                <isset property="user.properties.file"/>
    1.11 +            </not>
    1.12 +        </condition>
    1.13 +        <property file="${deploy.ant.properties.file}"/>
    1.14 +        <condition property="appserver.root" value="${sjsas.root}">
    1.15 +            <isset property="sjsas.root"/>
    1.16 +        </condition>
    1.17 +        <condition property="appserver.password" value="${sjsas.password}">
    1.18 +            <isset property="sjsas.password"/>
    1.19 +        </condition>
    1.20 +        <condition property="appserver.root" value="${gfv3.root}">
    1.21 +            <isset property="gfv3.root"/>
    1.22 +        </condition>
    1.23 +        <condition property="appserver.password" value="${gfv3.password}">
    1.24 +            <isset property="gfv3.password"/>
    1.25 +        </condition>
    1.26 +        <condition property="appserver.password" value="changeit">
    1.27 +            <not>
    1.28 +                <isset property="appserver.password"/>
    1.29 +            </not>
    1.30 +        </condition>
    1.31 +        <fail unless="user.properties.file">Must set user properties file</fail>
    1.32 +        <fail unless="appserver.root">Must set Sun app server root</fail>
    1.33 +        <fail unless="appserver.password">Must set Sun app server password</fail>
    1.34 +    </target>
    1.35 +    <target name="-create-wsit-prop" unless="do.not.create.wsit.prop">
    1.36 +        <echo file="nbproject/wsit.properties" message="AS_ADMIN_USERPASSWORD=${appserver.password}"/>
    1.37 +    </target>
    1.38 +    <target name="-delete-create-wsit-file" if="user.created">
    1.39 +        <delete file="nbproject/wsit.createuser"/>
    1.40 +    </target>
    1.41 +    <target name="create-user" unless="user.exists">
    1.42 +        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
    1.43 +            <arg value="create-file-user"/>
    1.44 +            <arg value="--passwordfile"/>
    1.45 +            <arg value="nbproject/wsit.properties"/>
    1.46 +            <arg value="wsitUser"/>
    1.47 +        </exec>
    1.48 +        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
    1.49 +            <arg value="create-file-user"/>
    1.50 +            <arg value="--passwordfile"/>
    1.51 +            <arg value="nbproject/wsit.properties"/>
    1.52 +            <arg value="wsitUser"/>
    1.53 +        </exec>
    1.54 +        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
    1.55 +            <arg value="create-file-user"/>
    1.56 +            <arg value="--passwordfile"/>
    1.57 +            <arg value="nbproject/wsit.properties"/>
    1.58 +            <arg value="wsitUser"/>
    1.59 +        </exec>
    1.60 +        <condition property="user.created">
    1.61 +            <and>
    1.62 +                <contains string="${creation.out}" substring="create-file-user"/>
    1.63 +                <contains string="${creation.out}" substring="success"/>
    1.64 +            </and>
    1.65 +        </condition>
    1.66 +        <antcall target="-delete-create-wsit-file"/>
    1.67 +    </target>
    1.68 +    <target name="-do-create-user" if="do-create-user">
    1.69 +        <available property="do.not.create.wsit.prop" file="nbproject/wsit.properties"/>
    1.70 +        <antcall target="-create-wsit-prop"/>
    1.71 +        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
    1.72 +            <arg value="list-file-users"/>
    1.73 +        </exec>
    1.74 +        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
    1.75 +            <arg value="list-file-users"/>
    1.76 +        </exec>
    1.77 +        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
    1.78 +            <arg value="list-file-users"/>
    1.79 +        </exec>
    1.80 +        <condition property="user.exists">
    1.81 +            <contains string="${as.users}" substring="wsitUser"/>
    1.82 +        </condition>
    1.83 +        <antcall target="create-user"/>
    1.84 +    </target>
    1.85 +    <target name="-post-run-deploy" depends="-wsit-init">
    1.86 +        <available property="do-create-user" file="nbproject/wsit.createuser"/>
    1.87 +        <antcall target="-do-create-user"/>
    1.88 +    </target>
    1.89 +</project>