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
franta-hg@98
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@98
     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">
franta-hg@98
     3
    <target name="-wsit-init">
franta-hg@98
     4
        <property file="nbproject/private/private.properties"/>
franta-hg@98
     5
        <condition property="user.properties.file" value="${netbeans.user}/build.properties">
franta-hg@98
     6
            <not>
franta-hg@98
     7
                <isset property="user.properties.file"/>
franta-hg@98
     8
            </not>
franta-hg@98
     9
        </condition>
franta-hg@98
    10
        <property file="${deploy.ant.properties.file}"/>
franta-hg@98
    11
        <condition property="appserver.root" value="${sjsas.root}">
franta-hg@98
    12
            <isset property="sjsas.root"/>
franta-hg@98
    13
        </condition>
franta-hg@98
    14
        <condition property="appserver.password" value="${sjsas.password}">
franta-hg@98
    15
            <isset property="sjsas.password"/>
franta-hg@98
    16
        </condition>
franta-hg@98
    17
        <condition property="appserver.root" value="${gfv3.root}">
franta-hg@98
    18
            <isset property="gfv3.root"/>
franta-hg@98
    19
        </condition>
franta-hg@98
    20
        <condition property="appserver.password" value="${gfv3.password}">
franta-hg@98
    21
            <isset property="gfv3.password"/>
franta-hg@98
    22
        </condition>
franta-hg@98
    23
        <condition property="appserver.password" value="changeit">
franta-hg@98
    24
            <not>
franta-hg@98
    25
                <isset property="appserver.password"/>
franta-hg@98
    26
            </not>
franta-hg@98
    27
        </condition>
franta-hg@98
    28
        <fail unless="user.properties.file">Must set user properties file</fail>
franta-hg@98
    29
        <fail unless="appserver.root">Must set Sun app server root</fail>
franta-hg@98
    30
        <fail unless="appserver.password">Must set Sun app server password</fail>
franta-hg@98
    31
    </target>
franta-hg@98
    32
    <target name="-create-wsit-prop" unless="do.not.create.wsit.prop">
franta-hg@98
    33
        <echo file="nbproject/wsit.properties" message="AS_ADMIN_USERPASSWORD=${appserver.password}"/>
franta-hg@98
    34
    </target>
franta-hg@98
    35
    <target name="-delete-create-wsit-file" if="user.created">
franta-hg@98
    36
        <delete file="nbproject/wsit.createuser"/>
franta-hg@98
    37
    </target>
franta-hg@98
    38
    <target name="create-user" unless="user.exists">
franta-hg@98
    39
        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
franta-hg@98
    40
            <arg value="create-file-user"/>
franta-hg@98
    41
            <arg value="--passwordfile"/>
franta-hg@98
    42
            <arg value="nbproject/wsit.properties"/>
franta-hg@98
    43
            <arg value="wsitUser"/>
franta-hg@98
    44
        </exec>
franta-hg@98
    45
        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
franta-hg@98
    46
            <arg value="create-file-user"/>
franta-hg@98
    47
            <arg value="--passwordfile"/>
franta-hg@98
    48
            <arg value="nbproject/wsit.properties"/>
franta-hg@98
    49
            <arg value="wsitUser"/>
franta-hg@98
    50
        </exec>
franta-hg@98
    51
        <exec timeout="10000" outputproperty="creation.out" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
franta-hg@98
    52
            <arg value="create-file-user"/>
franta-hg@98
    53
            <arg value="--passwordfile"/>
franta-hg@98
    54
            <arg value="nbproject/wsit.properties"/>
franta-hg@98
    55
            <arg value="wsitUser"/>
franta-hg@98
    56
        </exec>
franta-hg@98
    57
        <condition property="user.created">
franta-hg@98
    58
            <and>
franta-hg@98
    59
                <contains string="${creation.out}" substring="create-file-user"/>
franta-hg@98
    60
                <contains string="${creation.out}" substring="success"/>
franta-hg@98
    61
            </and>
franta-hg@98
    62
        </condition>
franta-hg@98
    63
        <antcall target="-delete-create-wsit-file"/>
franta-hg@98
    64
    </target>
franta-hg@98
    65
    <target name="-do-create-user" if="do-create-user">
franta-hg@98
    66
        <available property="do.not.create.wsit.prop" file="nbproject/wsit.properties"/>
franta-hg@98
    67
        <antcall target="-create-wsit-prop"/>
franta-hg@98
    68
        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="unix">
franta-hg@98
    69
            <arg value="list-file-users"/>
franta-hg@98
    70
        </exec>
franta-hg@98
    71
        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin" failonerror="false" failifexecutionfails="false" osfamily="mac">
franta-hg@98
    72
            <arg value="list-file-users"/>
franta-hg@98
    73
        </exec>
franta-hg@98
    74
        <exec timeout="10000" outputproperty="as.users" executable="${appserver.root}/bin/asadmin.bat" failonerror="false" failifexecutionfails="false" osfamily="windows">
franta-hg@98
    75
            <arg value="list-file-users"/>
franta-hg@98
    76
        </exec>
franta-hg@98
    77
        <condition property="user.exists">
franta-hg@98
    78
            <contains string="${as.users}" substring="wsitUser"/>
franta-hg@98
    79
        </condition>
franta-hg@98
    80
        <antcall target="create-user"/>
franta-hg@98
    81
    </target>
franta-hg@98
    82
    <target name="-post-run-deploy" depends="-wsit-init">
franta-hg@98
    83
        <available property="do-create-user" file="nbproject/wsit.createuser"/>
franta-hg@98
    84
        <antcall target="-do-create-user"/>
franta-hg@98
    85
    </target>
franta-hg@98
    86
</project>