| <?xml version="1.0" encoding="UTF-8"?> |
| <project default="deploy-tomcat" name="roller_personal"> |
| |
| <!-- |
| This is an example build script that shows how you can: |
| |
| * deploy Roller to a local Tomcat for development and testing. |
| * deploy Roller to a local Resin/MySQL for development and testing. |
| * deploy Roller to a remote ISP using FTP |
| |
| This script is designed to be called from the main Roller build script. |
| Before you can use it, you'll have to edit ant.properties to set your |
| app server locations, FTP address, usernames, passwords, etc. |
| --> |
| |
| <property file="ant.properties"/> |
| |
| <!-- ********************************************************************** --> |
| <!-- Local tomcat --> |
| <!-- ********************************************************************** --> |
| |
| <target name="deploy-tomcat"> |
| |
| <!-- Fixup the web.xml so that it is ready for deployment --> |
| <replace file="${staging}/WEB-INF/web.xml" |
| token="<!-- TOMCAT_RESOURCE_REF -->"> |
| <replacevalue><![CDATA[ |
| <resource-ref> |
| <res-ref-name>jdbc/rollerdb</res-ref-name> |
| <res-type>javax.sql.DataSource</res-type> |
| <res-auth>Container</res-auth> |
| </resource-ref> |
| ]]></replacevalue> |
| </replace> |
| <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" /> |
| |
| <!-- ask Tomcat manager to UN-DEPLOY Roller |
| <get src="http://localhost:${catalina.port}/manager/remove?path=/${webapp.name}" |
| dest="remove-out.txt" |
| username="${catalina.username}" password="${catalina.password}" /> |
| <loadfile property="remove-out" srcFile="remove-out.txt"/> |
| <echo>${remove-out}</echo> --> |
| |
| <!-- copy Roller files to Tomcat directory --> |
| <mkdir dir="${catalina.home}/webapps/${webapp.name}"/> |
| <copy todir="${catalina.home}/webapps/${webapp.name}"> |
| <fileset dir="${staging}" includes="**/**"/> |
| </copy> |
| |
| <!-- ask Tomcat manager to RE-DEPLOY Roller |
| <get src="http://localhost:${catalina.port}/manager/install?path=/${webapp.name}&war=file://${catalina.home}/webapps/${webapp.name}" |
| dest="install-out.txt" |
| username="${catalina.username}" password="${catalina.password}" /> |
| <loadfile property="install-out" srcFile="install-out.txt"/> |
| <echo>${install-out}</echo> --> |
| |
| </target> |
| |
| |
| <!-- ********************************************************************** --> |
| <!-- Local resin --> |
| <!-- ********************************************************************** --> |
| |
| <target name="deploy-resin"> |
| |
| <property name="webapps" value="${resin.home}/webapps"/> |
| |
| <replace file="${staging}/WEB-INF/web.xml" |
| token="<!-- RESIN_LOGGER -->"> |
| <replacevalue><![CDATA[ |
| <access-log href="WEB-INF/logs/access.log" /> |
| <stdout-log href="WEB-INF/logs/stdout.log" /> |
| <stderr-log href="WEB-INF/logs/error.log" /> |
| <resource-ref> |
| <res-ref-name>jdbc/rollerdb</res-ref-name> |
| <res-type>javax.sql.ConnectionPoolDataSource</res-type> |
| <init-param driver-name="org.gjt.mm.mysql.jdbc2.optional.MysqlConnectionPoolDataSource"/> |
| <init-param serverName="localhost"/> |
| <init-param user="${resin.username}"/> |
| <init-param password="${resin.password}"/> |
| <init-param port="3306"/> |
| <init-param databaseName="roller" /> |
| </resource-ref> |
| ]]></replacevalue> |
| </replace> |
| |
| <replace file="${staging}/WEB-INF/web.xml" |
| token="<!-- RESIN_AUTHENTICATOR -->"> |
| <replacevalue><![CDATA[ |
| <authenticator> |
| <class-name>com.caucho.http.security.XmlAuthenticator</class-name> |
| <init-param user="${resin.username}:${resin.password}:editor" /> |
| </authenticator> |
| ]]></replacevalue> |
| </replace> |
| |
| <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" /> |
| |
| <copy todir="${staging}"> |
| <fileset dir="../docs" includes="**/*.html"/> |
| <fileset dir="../docs" includes="**/*.gif"/> |
| <fileset dir="../docs" includes="**/*.jpg"/> |
| </copy> |
| |
| <copy todir="${staging}/WEB-INF" overwrite="yes" > |
| <fileset dir="./resin" includes="velocity.properties"/> |
| <fileset dir="./resin" includes="database.xml"/> |
| </copy> |
| |
| <mkdir dir="${webapps}/roller"/> |
| <copy todir="${webapps}/roller"> |
| <fileset dir="${staging}" includes="**/**"/> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ********************************************************************* --> |
| <!-- Remote ISP via FTP --> |
| <!-- ********************************************************************* --> |
| |
| <target name="deploy-isp"> |
| |
| <replace file="${staging}/WEB-INF/web.xml" |
| token="<!-- TOMCAT_RESOURCE_REF -->"> |
| <replacevalue><![CDATA[ |
| <resource-ref> |
| <res-ref-name>jdbc/rollerdb</res-ref-name> |
| <res-type>javax.sql.DataSource</res-type> |
| <res-auth>Container</res-auth> |
| </resource-ref> |
| ]]></replacevalue> |
| </replace> |
| |
| <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" /> |
| |
| <ftp server="${ftp.host}" |
| remotedir="/public_html" |
| userid="${ftp.username}" |
| password="${ftp.password}" |
| ignoreNoncriticalErrors="yes" |
| depends="yes" |
| verbose="yes"> |
| <fileset dir="${staging}"> |
| |
| <!-- copy everything |
| <include name="**"/> |
| --> |
| |
| <!-- copy only code changes --> |
| <exclude name="**/web.xml"/> |
| <exclude name="**/roller-config.xml"/> |
| <exclude name="**/oscache.propertiesl"/> |
| <exclude name="**/log4j.properties"/> |
| <include name="**/*.xml"/> |
| <include name="**/*.vm"/> |
| <include name="**/*.tld"/> |
| <include name="**/*.css"/> |
| <include name="**/*.html"/> |
| <include name="**/*.htm"/> |
| <include name="**/*.jsp"/> |
| <include name="**/*.gif"/> |
| <include name="**/*.png"/> |
| <include name="**/WEB-INF/lib/rollerweb.jar"/> |
| <include name="**/WEB-INF/lib/rollerbeans.jar"/> |
| |
| <exclude name="**/newuser.jsp"/> |
| |
| </fileset> |
| </ftp> |
| </target> |
| |
| </project> |
| |