<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bradley Holt &#187; Phing</title>
	<atom:link href="http://bradley-holt.com/tag/phing/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradley-holt.com</link>
	<description></description>
	<lastBuildDate>Fri, 06 Jan 2012 18:57:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Phing Build Script</title>
		<link>http://bradley-holt.com/2010/01/phing-build-script/</link>
		<comments>http://bradley-holt.com/2010/01/phing-build-script/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 16:03:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Phing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Deployment]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2010/01/phing-build-script/</guid>
		<description><![CDATA[I&#8217;ve been experimenting with using Phing to automate building and deploying web applications. I want to share one of my build scripts and perhaps get some feedback from anyone with more experience using Phing. The requirements for the build script are fairly simple: It will not handle deployment. This particular web application is deployed by [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with using <a href="http://phing.info/">Phing</a> to automate building and deploying web applications. I want to share one of my build scripts and perhaps get some feedback from anyone with more experience using Phing. The requirements for the build script are fairly simple:</p>
<ul>
<li>It will <em>not</em> handle deployment. This particular web application is deployed by the client&#8217;s IT department.</li>
<li>It <em>will</em>  create a ZIP file (it could just as easily create a tar.gz file) that the client&#8217;s IT department can extract and deploy.</li>
<li>It <em>will</em> rename the document root since the document root is a different directory name in the client&#8217;s production environment then it is in our development and testing environments.</li>
</ul>
<p>Next, an outline of what the build does:</p>
<ol>
<li>Prompt for Subversion credentials (I&#8217;d rather not store these in a file).</li>
<li>Prompt for the Subversion tag to build from.</li>
<li>Delete the source directory if it exists.</li>
<li>Export the given tag to the source directory.</li>
<li>Rename the document root.</li>
<li>Create a ZIP file, named after the version, of the source directory&#8217;s contents.</li>
<li>Clean up after itself by deleting the source directory.</li>
</ol>
<p>Both of the build files are in the project&#8217;s root directory (in my project, this is one directory above the document root). The <a href="http://gist.github.com/273555#file_build.properties">build.properties</a> file defines three properties: document root (so we can rename it to this new name), the source directory (the place to export to and then manipulate folders/files), and the URL to the repository&#8217;s tags directory.</p>
<p><script src="http://gist.github.com/273555.js?file=build.properties"></script>
<p>The <a href="http://gist.github.com/273555#file_build.xml">build.xml</a> file is the actual build script, performing the actions outlined above. I&#8217;ve obfuscated the project name to be &#8220;acme&#8221;. I could not find a way to create a prompt that hides the Subversion password as it is entered (anyone?). For renaming the document root, I used the <code>exec</code> task to execute a move (<code>mv</code>) command since the <code>move</code> task failed for me (so this script will not work as-is on Windows).</p>
<p><script src="http://gist.github.com/273555.js?file=build.xml"></script>
<p>Executing this script is as easy as running <code>phing build-tag</code> (once Phing is installed) from within the project&#8217;s root directory. Please let me know if you have any questions or see any room for improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2010/01/phing-build-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

