java/nekurak.net-web/nbproject/ant-deploy.xml
changeset 43 394ec61e99d7
parent 0 b85f351aa5e5
child 142 44ef544460ca
     1.1 --- a/java/nekurak.net-web/nbproject/ant-deploy.xml	Sat Dec 19 18:17:39 2009 +0100
     1.2 +++ b/java/nekurak.net-web/nbproject/ant-deploy.xml	Thu Feb 25 16:01:46 2010 +0100
     1.3 @@ -4,12 +4,12 @@
     1.4          <property file="${deploy.ant.properties.file}" />
     1.5          <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
     1.6          <available file="${deploy.ant.resource.dir}" property="has.setup"/>
     1.7 -        <tempfile prefix="sjsas" property="sjsas.password.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
     1.8 -        <echo message="AS_ADMIN_PASSWORD=${sjsas.password}" file="${sjsas.password.file}"/>
     1.9 +        <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.10 +        <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
    1.11      </target>
    1.12      
    1.13      <target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
    1.14 -        <tempfile prefix="sjsas" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
    1.15 +        <tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
    1.16          <copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
    1.17          <!-- The doctype triggers resolution which can fail -->
    1.18          <replace file="${temp.sun.web}">
    1.19 @@ -23,38 +23,38 @@
    1.20          <xmlproperty file="${temp.sun.web}" validate="false">
    1.21          </xmlproperty>    
    1.22          <delete file="${temp.sun.web}"/>
    1.23 -        <property name="deploy.ant.client.url" value="${sjsas.url}${sun-web-app.context-root}"/>
    1.24 +        <property name="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}"/>
    1.25 +        <property name="deploy.context.root.argument" value="?contextroot=${sun-web-app.context-root}"/>
    1.26 +    </target>
    1.27 +    <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
    1.28 +        <property name="deploy.context.root.argument" value=""/>
    1.29      </target>
    1.30      <target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
    1.31 -        <tempfile prefix="sjsas" property="sjsas.resources.dir" destdir="${java.io.tmpdir}"/>
    1.32 -        <mkdir dir="${sjsas.resources.dir}"/>
    1.33 -        <mkdir dir="${sjsas.resources.dir}/META-INF"/>
    1.34 -        <property name="sjsas.resources.file" value="${sjsas.resources.dir}/META-INF/sun-resources.xml"/>
    1.35 -        <copy todir="${sjsas.resources.dir}/META-INF">
    1.36 +        <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
    1.37 +        <mkdir dir="${gfv3.resources.dir}"/>
    1.38 +        <mkdir dir="${gfv3.resources.dir}/META-INF"/>
    1.39 +        <property name="gfv3.resources.file" value="${gfv3.resources.dir}/META-INF/sun-resources.xml"/>
    1.40 +        <copy todir="${gfv3.resources.dir}/META-INF">
    1.41              <fileset dir="${deploy.ant.resource.dir}"/>
    1.42          </copy>
    1.43          <jar destfile="${deploy.ant.archive}" update="true">
    1.44 -            <fileset dir="${sjsas.resources.dir}"/>
    1.45 +            <fileset dir="${gfv3.resources.dir}"/>
    1.46          </jar>
    1.47 -        <delete dir="${sjsas.resources.dir}"/>
    1.48 +        <delete dir="${gfv3.resources.dir}"/>
    1.49      </target>
    1.50 -    <target name="-deploy-ant" depends="-parse-sun-web,-add-resources" if="deploy.ant.enabled">
    1.51 +    <target name="-deploy-ant" depends="-parse-sun-web,-no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
    1.52          <echo message="Deploying ${deploy.ant.archive}"/>
    1.53 -        <taskdef name="sun-appserv-deploy" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask"
    1.54 -                 classpath="${sjsas.root}/lib/sun-appserv-ant.jar" />
    1.55 -        <sun-appserv-deploy user="${sjsas.username}"
    1.56 -                passwordfile="${sjsas.password.file}"
    1.57 -                host="${sjsas.host}" port="${sjsas.port}"
    1.58 -                file="${deploy.ant.archive}" asinstalldir="${sjsas.root}"/>
    1.59 -        <delete file="${sjsas.password.file}"/>
    1.60 +        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.61 +        <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
    1.62 +        <get src="${gfv3.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}?force=true?name=${ant.project.name}"
    1.63 +            dest="${gfv3.results.file}"/>
    1.64 +        <delete file="${gfv3.results.file}"/>    
    1.65      </target>
    1.66      <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
    1.67 -        <taskdef name="sun-appserv-undeploy" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask"
    1.68 -                 classpath="${sjsas.root}/lib/sun-appserv-ant.jar" />
    1.69 -        <sun-appserv-undeploy user="${sjsas.username}"
    1.70 -                passwordfile="${sjsas.password.file}"
    1.71 -                host="${sjsas.host}" port="${sjsas.port}"
    1.72 -                file="${deploy.ant.archive}" asinstalldir="${sjsas.root}"/>
    1.73 -        <delete file="${sjsas.password.file}"/>
    1.74 +        <echo message="Undeploying ${deploy.ant.archive}"/>
    1.75 +        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! -->
    1.76 +        <get src="${gfv3.url}/__asadmin/undeploy?name=${ant.project.name}"
    1.77 +            dest="${gfv3.results.file}"/>
    1.78 +        <delete file="${gfv3.results.file}"/>    
    1.79      </target>
    1.80  </project>