author | František Kučera <franta-hg@frantovo.cz> |
Sat Jun 19 14:00:11 2010 +0200 (2010-06-19) | |
changeset 143 | 91c4282ea15f |
parent 75 | 18ed62105526 |
child 186 | b0f7d9ab4a07 |
permissions | -rw-r--r-- |
franta-hg@75 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
franta-hg@75 | 2 |
<project default="-deploy-ant" basedir="."> |
franta-hg@75 | 3 |
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
franta-hg@75 | 4 |
<property file="${deploy.ant.properties.file}" /> |
franta-hg@75 | 5 |
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
franta-hg@75 | 6 |
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
franta-hg@75 | 7 |
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
franta-hg@75 | 8 |
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
franta-hg@75 | 9 |
</target> |
franta-hg@75 | 10 |
|
franta-hg@75 | 11 |
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
franta-hg@75 | 12 |
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
franta-hg@75 | 13 |
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
franta-hg@75 | 14 |
<!-- The doctype triggers resolution which can fail --> |
franta-hg@75 | 15 |
<replace file="${temp.sun.web}"> |
franta-hg@75 | 16 |
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
franta-hg@75 | 17 |
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
franta-hg@75 | 18 |
</replace> |
franta-hg@75 | 19 |
<replace file="${temp.sun.web}"> |
franta-hg@75 | 20 |
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
franta-hg@75 | 21 |
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
franta-hg@75 | 22 |
</replace> |
franta-hg@75 | 23 |
<xmlproperty file="${temp.sun.web}" validate="false"> |
franta-hg@75 | 24 |
</xmlproperty> |
franta-hg@75 | 25 |
<delete file="${temp.sun.web}"/> |
franta-hg@75 | 26 |
<property name="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}"/> |
franta-hg@142 | 27 |
<property name="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}"/> |
franta-hg@75 | 28 |
</target> |
franta-hg@75 | 29 |
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
franta-hg@75 | 30 |
<property name="deploy.context.root.argument" value=""/> |
franta-hg@75 | 31 |
</target> |
franta-hg@75 | 32 |
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
franta-hg@75 | 33 |
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
franta-hg@75 | 34 |
<mkdir dir="${gfv3.resources.dir}"/> |
franta-hg@75 | 35 |
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
franta-hg@75 | 36 |
<property name="gfv3.resources.file" value="${gfv3.resources.dir}/META-INF/sun-resources.xml"/> |
franta-hg@75 | 37 |
<copy todir="${gfv3.resources.dir}/META-INF"> |
franta-hg@75 | 38 |
<fileset dir="${deploy.ant.resource.dir}"/> |
franta-hg@75 | 39 |
</copy> |
franta-hg@75 | 40 |
<jar destfile="${deploy.ant.archive}" update="true"> |
franta-hg@75 | 41 |
<fileset dir="${gfv3.resources.dir}"/> |
franta-hg@75 | 42 |
</jar> |
franta-hg@75 | 43 |
<delete dir="${gfv3.resources.dir}"/> |
franta-hg@75 | 44 |
</target> |
franta-hg@75 | 45 |
<target name="-deploy-ant" depends="-parse-sun-web,-no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
franta-hg@142 | 46 |
<antcall target="-deploy-without-pw"/> |
franta-hg@142 | 47 |
<antcall target="-deploy-with-pw"/> |
franta-hg@142 | 48 |
</target> |
franta-hg@142 | 49 |
|
franta-hg@142 | 50 |
<target name="-deploy-without-pw" unless="gfv3.password"> |
franta-hg@75 | 51 |
<echo message="Deploying ${deploy.ant.archive}"/> |
franta-hg@75 | 52 |
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
franta-hg@75 | 53 |
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
franta-hg@142 | 54 |
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
franta-hg@75 | 55 |
dest="${gfv3.results.file}"/> |
franta-hg@75 | 56 |
<delete file="${gfv3.results.file}"/> |
franta-hg@75 | 57 |
</target> |
franta-hg@142 | 58 |
<target name="-deploy-with-pw" if="gfv3.password"> |
franta-hg@142 | 59 |
<echo message="Deploying ${deploy.ant.archive}"/> |
franta-hg@142 | 60 |
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
franta-hg@142 | 61 |
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
franta-hg@142 | 62 |
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
franta-hg@142 | 63 |
dest="${gfv3.results.file}"/> |
franta-hg@142 | 64 |
<delete file="${gfv3.results.file}"/> |
franta-hg@142 | 65 |
</target> |
franta-hg@75 | 66 |
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
franta-hg@142 | 67 |
<antcall target="-undeploy-without-pw"/> |
franta-hg@142 | 68 |
<antcall target="-undeploy-with-pw"/> |
franta-hg@142 | 69 |
</target> |
franta-hg@142 | 70 |
|
franta-hg@142 | 71 |
<target name="-undeploy-without-pw" unless="gfv3.password"> |
franta-hg@75 | 72 |
<echo message="Undeploying ${deploy.ant.archive}"/> |
franta-hg@75 | 73 |
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
franta-hg@142 | 74 |
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
franta-hg@75 | 75 |
dest="${gfv3.results.file}"/> |
franta-hg@75 | 76 |
<delete file="${gfv3.results.file}"/> |
franta-hg@75 | 77 |
</target> |
franta-hg@142 | 78 |
<target name="-undeploy-with-pw" if="gfv3.password"> |
franta-hg@142 | 79 |
<echo message="Undeploying ${deploy.ant.archive}"/> |
franta-hg@142 | 80 |
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
franta-hg@142 | 81 |
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
franta-hg@142 | 82 |
dest="${gfv3.results.file}"/> |
franta-hg@142 | 83 |
<delete file="${gfv3.results.file}"/> |
franta-hg@142 | 84 |
</target> |
franta-hg@75 | 85 |
</project> |