<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Code in the hole (Entries tagged as deployment)</title>
    <link>http://codeinthehole.com/</link>
    <description>David Winterbottom</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Phing trick for avoiding deploying debug code</title>
    <link>http://codeinthehole.com/archives/34-Phing-trick-for-avoiding-deploying-debug-code.html</link>
            <category>Deployment</category>
    
    <comments>http://codeinthehole.com/archives/34-Phing-trick-for-avoiding-deploying-debug-code.html#comments</comments>
    <wfw:comment>http://codeinthehole.com/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://codeinthehole.com/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (David Winterbottom)</author>
    <content:encoded>
    &lt;blockquote&gt;Fool me once, shame on you; fool me twice, shame on me&lt;/blockquote&gt;

&lt;p&gt;Ensuring mistakes aren&#039;t repeated is a commonplace activity for any development team.  This can manifest itself in many ways such as writing regression tests, stepping up your code reviews, adding stories to a testing plan or humiliating the developer in question through use of an unusual (dunce&#039;s) hat.&lt;/p&gt;

&lt;p&gt;We had an issue recently where some debugging code got committed and wasn&#039;t picked up during testing.  Naturally, this code was picked up once it hit the production environment, we put rapidly put a patch in place.  An embarrassing moment but the kind of thing that happens from time to time down in the trenches.&lt;/p&gt;

&lt;p&gt;One possible remedy for this would be to add a new sniff to the in-house coding standard (which is tested using the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pear.php.net/package/PHP_CodeSniffer/redirected&#039;);&quot;  href=&quot;http://pear.php.net/package/PHP_CodeSniffer/redirected&quot;&gt;PEAR code sniffer&lt;/a&gt; on a SVN pre-commit hook) to look for debugging code and block the commit if any is found.  However, a quicker solution was to modify our deployment scripts to search the codebase and bail out if any debug code was found.  We use &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/trac/&#039;);&quot;  href=&quot;http://phing.info/trac/&quot;&gt;phing&lt;/a&gt; as our deployment tool - here&#039;s the appropriate section from our build file:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;echo msg=&quot;Checking codebase for use of var_dump()&quot; /&amp;gt;
&amp;lt;exec command=&quot;[ `find ${folder.app.export}/classes -name &#039;*.php&#039; | xargs grep -nr &#039;\(^\s*|\s\+\)var_dump(.*\?);&#039; | wc -l` -eq 0 ]&quot; dir=&quot;.&quot; checkreturn=&quot;true&quot; /&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The command here is grepping all PHP files within the SVN export for occurrences of &lt;code&gt;var_dump&lt;/code&gt;.  If any such matching lines are found then a non-zero exit will be returned and the build will fail.   We haven&#039;t had such an issue since.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 22 Aug 2010 15:41:54 +0000</pubDate>
    <guid isPermaLink="false">http://codeinthehole.com/archives/34-guid.html</guid>
    <category>deployment</category>
<category>phing</category>
<category>php</category>

</item>
<item>
    <title>Deploying cron jobs using Phing</title>
    <link>http://codeinthehole.com/archives/29-Deploying-cron-jobs-using-Phing.html</link>
            <category>Development</category>
    
    <comments>http://codeinthehole.com/archives/29-Deploying-cron-jobs-using-Phing.html#comments</comments>
    <wfw:comment>http://codeinthehole.com/wfwcomment.php?cid=29</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://codeinthehole.com/rss.php?version=2.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    

    <author>nospam@example.com (David Winterbottom)</author>
    <content:encoded>
    &lt;p&gt;Deploying applications that depend on cron-jobs can be a pain.  However, Phing can be used to make such deployments easy - here&#039;s how...&lt;/p&gt;

&lt;p&gt;Consider an application folder structure as follows:&lt;/p&gt;
&lt;pre style=&quot;padding: 15px;&quot;&gt;
/builds
    /development
    /test
    /stage
/src
    /cron.d
        appname-__BUILD__-order-processing
    /scripts
        /order-processing
            handle-ready-to-ship-orders.php
            handle-cancellations.php
            ...
    /public
    /classes
        ...
&lt;/pre&gt;
&lt;p&gt;All development work takes place within the &lt;code&gt;/src&lt;/code&gt; folder while the &lt;code&gt;/builds/*&lt;/code&gt; folders are used as targets in deployment.  This system allows multiple builds to happily co-exist on the same server and the whole application infrastructure to be moved between servers easily as the structure in source control mirrors that of the server.&lt;/p&gt;
&lt;p&gt;In this example e-commerce app, we have a number of scripts (in &lt;code&gt;/src/scripts&lt;/code&gt;) that handle order-processing which need to be called periodically by the cron daemon.  A naive approach in deployment would be to export the codebase to an appropriate build folder but then edit the server&#039;s crontab by hand and add the appropriate lines to run these scripts.&lt;/p&gt;

&lt;p&gt;This isn&#039;t such a great idea though as it relies on that most unreliable facility, human memory, to ensure the build is fully deployed - this creates an unnecessary overhead which is bound to lead to mistakes.  Furthermore, the overhead acts as a deterrent for using asynchronous jobs within an application, limiting the app in terms of what it can do.  As far as I am aware, there is no easy way to automatically update a user&#039;s crontab automatically.&lt;/p&gt;

&lt;p&gt;A much better way is to create a number of scripts which specify the cron tasks and are deployed to the &lt;code&gt;/etc/cron.d&lt;/code&gt; folder.  In the above example, these are stored in &lt;code&gt;/src/cron.d&lt;/code&gt; and would look something like:&lt;/p&gt;
&lt;code class=&quot;prettyprint&quot; style=&quot;white-space:nowrap&quot;&gt;15 * * * *   root   /var/www/ecommerce.com/builds/__BUILD__/scripts/handle-ready-to-ship-orders.php &gt; /dev/null 2&gt;&gt; /var/log/cron.errors.log
35 * * * *   root   /var/www/ecommerce.com/builds/__BUILD__/scripts/handle-cancellations.php &gt; /dev/null 2&gt;&gt; /var/log/cron.errors.log&lt;/code&gt;
&lt;p&gt;
(Note that, for some reason, a blank line is required at the end of this file in order for the script to be run by cron.)  Here, the &lt;code&gt;__BUILD__&lt;/code&gt; is a tokenised parameter which will be replaced during deployment to configure the path to the appropriate script - a &lt;a href=&quot;http://codeinthehole.com/archives/25-Using-a-Phing-filter-to-flush-browser-caches.html&quot;&gt;phing trick I&#039;ve described previously&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
One further complication is that if both the dev, test and stage builds are running on the same server, then the scripts deployed to &lt;code&gt;/etc/cron.d&lt;/code&gt; could clobber each other as they have the same name within each build.  This can be neatly side-stepped using the Phing&#039;s glob mapper to replace the &lt;code&gt;__BUILD__&lt;/code&gt; component of the file to be the appropriate build name (similar to how the paths are configured within the file itself).&lt;/p&gt;
&lt;p&gt;This is probably best illustrated with a sample phing script which takes the build name (eg &quot;development&quot;) as a parameter:
&lt;/p&gt;
&lt;code class=&quot;prettyprint&quot;&gt;&amp;lt;xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&amp;lt;project&gt;
    &amp;lt;target name=&quot;deploy&quot;&gt;
        ...
        &amp;lt;delete&gt;
            &amp;lt;fileset dir=&quot;/etc/cron.d/&quot;&gt;
                &amp;lt;include name=&quot;appname-${build.name}-*&quot; /&gt;
            &amp;lt;/fileset&gt;
        &amp;lt;/delete&gt;
        &amp;lt;copy todir=&quot;/etc/cron.d/&quot;&gt; 
            &amp;lt;filterchain&gt;
                &amp;lt;replacetokens begintoken=&quot;__&quot; endtoken=&quot;__&quot;&gt;
                    &amp;lt;token key=&quot;BUILD&quot; value=&quot;${build.name}&quot; /&gt;
                &amp;lt;/replacetokens&gt;
            &amp;lt;/filterchain&gt;
            &amp;lt;mapper type=&quot;glob&quot; from=&quot;appname-__BUILD__-*&quot; to=&quot;appname-${build.name}-*&quot; /&gt;
            &amp;lt;fileset dir=&quot;${path.to.build}/cron.d&quot;&gt;
                &amp;lt;include name=&quot;appname-__BUILD__-*&quot; /&gt;
            &amp;lt;/fileset&gt;
        &amp;lt;/copy&gt;
    &amp;lt;/target&gt;
&amp;lt;/project&gt;
&lt;/code&gt;
&lt;p&gt;The illustrated snippet does two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Deletes any previous scripts for this build from &lt;code&gt;/etc/cron.d&lt;/code&gt; (this is why we namespace the files with &quot;appname&quot; to prevent accidentally removing a system file).&lt;/li&gt;
&lt;li&gt;Copies the new scripts into &lt;code&gt;/etc/cron.d&lt;/code&gt; while replacing the token &lt;code&gt;__BUILD__&lt;/code&gt; with the build name in both the file contents and file names.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After separate deployments for dev and stage, we should find the following:&lt;/p&gt;
&lt;pre style=&quot;padding: 15px;&quot;&gt;
/etc
    /cron.d
        appname-development-order-processing
        appname-stage-order-processing
        ...
&lt;/pre&gt;
&lt;p&gt;where, for instance, the contents of &lt;code&gt;/etc/cron.d/appname-development-order-processing&lt;/code&gt; would be:&lt;/p&gt;
&lt;code class=&quot;prettyprint&quot;&gt;* * * * *   root   /var/www/ecommerce.com/builds/development/scripts/handle-ready-to-ship-orders.php
* * * * *   root   /var/www/ecommerce.com/builds/development/scripts/handle-cancellations.php
...
&lt;/code&gt;
&lt;p&gt;
Having automatic and reliable deployment of cron-jobs in place is quite liberating.  Suddenly, lots of application processing can be done asynchronously without worrying about the overhead of maintaining the appropriate crontabs by hand.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 31 May 2009 17:32:02 +0000</pubDate>
    <guid isPermaLink="false">http://codeinthehole.com/archives/29-guid.html</guid>
    <category>deployment</category>
<category>phing</category>
<category>php</category>

</item>
<item>
    <title>Using a Phing filter to flush browser caches</title>
    <link>http://codeinthehole.com/archives/25-Using-a-Phing-filter-to-flush-browser-caches.html</link>
            <category>Deployment</category>
    
    <comments>http://codeinthehole.com/archives/25-Using-a-Phing-filter-to-flush-browser-caches.html#comments</comments>
    <wfw:comment>http://codeinthehole.com/wfwcomment.php?cid=25</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://codeinthehole.com/rss.php?version=2.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    

    <author>nospam@example.com (David Winterbottom)</author>
    <content:encoded>
    &lt;p&gt;A quick &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/trac/&#039;);&quot;  href=&quot;http://phing.info/trac/&quot;&gt;Phing&lt;/a&gt; tip that&#039;s made my life easier when deploying new versions of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.commandlinefu.com&#039;);&quot;  href=&quot;http://www.commandlinefu.com&quot;&gt;commandlinefu.com&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt;One of the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/stevesouders.com/hpws/rule-expires.php&#039;);&quot;  href=&quot;http://stevesouders.com/hpws/rule-expires.php&quot;&gt;key performance recommendations&lt;/a&gt; from Steve Souders&#039; excellent &amp;quot;High Performance Websites&amp;quot; is to use Expires HTTP headers to set far-future expiration dates for your site components (such as images, Javascript files and CSS stylesheets).  This way, browsers can cache the files between requests giving a performance boost to your site.  Assuming you&#039;re using Apache for serving, the following settings can be used to set these headers for all Javascript and CSS files (there are a few alternative ways of achieving the same result):&lt;/p&gt;

&lt;code class=&quot;prettyprint&quot;&gt;&amp;lt;FilesMatch &quot;\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$&quot;&gt;
    Header set Expires &quot;Thu, 15 Apr 2010 20:00:00 GMT&quot;
&amp;lt;/FilesMatch&gt;&lt;/code&gt;

&lt;p&gt;The main issue to be aware of using this technique is that, when your components change, you need to ensure your visitors are forced to download the latest version rather than using the one cached by their browser.  The only way to ensure this happens is to use a different URL for the assets in question.  One option might be to rename the files themselves but a more convenient alternative is to include a query string as part of the request URL (eg &lt;code&gt;&amp;lt;script src=&amp;quot;/js/behaviour.js?2009-03-15&amp;quot; type=&amp;quot;text/javascript&amp;quot; /&amp;gt;&lt;/code&gt;).  Then changing the query string component is sufficient to force browsers to make a full request for the new component.  &lt;/p&gt;&lt;p&gt;This works well but is an easy-to-forget overhead for deployment.  However, this substitution can be automated by making use of the Filters that Phing provides.  Doing so is trivial: simply insert a tokenised string as the query string after your asset URLs.  That is:&lt;/p&gt;

&lt;code class=&quot;prettyprint&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://codeinthehole.com/css/styles.css?~~CACHEBUSTER~~&quot; type=&quot;text/css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://codeinthehole.com/js/site-behaviour.js?~~CACHEBUSTER~~&quot;&gt;&lt;/script&gt;&lt;/code&gt;

&lt;p&gt;where the &#039;~~&#039; delimiter indicates the token.  Then include something like the following snippet in your Phing deployment script.&lt;/p&gt;

&lt;code class=&quot;prettyprint&quot;&gt;&amp;lt;tstamp&gt;
    &amp;lt;format property=&quot;build.datetimestring&quot; pattern=&quot;%Y-%m-%d-%H-%M&quot; /&gt;
&amp;lt;/tstamp&gt;
...
&amp;lt;target name=&quot;create-temp-build&quot; description=&quot;Creates a temporary copy of the source files&quot;&gt;	
    &amp;lt;echo msg=&quot;Copying deployment files into temporary directory&quot; /&gt;
    &amp;lt;copy todir=&quot;${dev.folder.temp}&quot;&gt;
        &amp;lt;filterchain&gt;
            &amp;lt;replacetokens begintoken=&quot;~~&quot; endtoken=&quot;~~&quot;&gt;
                &amp;lt;token key=&quot;CACHEBUSTER&quot; value=&quot;${build.datetimestring}&quot; /&gt;
            &amp;lt;/replacetokens&gt;
        &amp;lt;/filterchain&gt;
	&amp;lt;fileset refid=&quot;deployment-files&quot; /&gt;
    &amp;lt;/copy&gt;
&amp;lt;/target&gt;&lt;/code&gt;

&lt;p&gt;The filterchain component of the copy task parses the given fileset for matching tokens that match and replaces them with the given value.  In this example, I&#039;m using timestamps as the replacements as these will ensure a different query string on each deployment.  Doing so ensures that the deployed HTML includes the lines:&lt;/p&gt;

&lt;code class=&quot;prettyprint&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://codeinthehole.com/css/styles.css?2008-03-15-21-51&quot; type=&quot;text/css&quot; /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://codeinthehole.com/js/site-behaviour.js?2008-03-15-21-51&quot;&gt;&lt;/script&gt;&lt;/code&gt;

&lt;p&gt;which then ensure that all subsequent visitors download the latest versions of the CSS and javascript files.  The above target is taken from a deployment script I use which creates a temporary snapshot of the codebase that I want to deploy, but the basic principle of using the &lt;code class=&quot;prettyprint&quot;&gt;replacetokens&lt;/code&gt; filter is easily transferable to any deployment script.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 15 Mar 2009 19:01:13 +0000</pubDate>
    <guid isPermaLink="false">http://codeinthehole.com/archives/25-guid.html</guid>
    <category>commandlinefu</category>
<category>deployment</category>
<category>phing</category>
<category>php</category>

</item>
<item>
    <title>Deploying to a shared hosting environment using Phing</title>
    <link>http://codeinthehole.com/archives/13-Deploying-to-a-shared-hosting-environment-using-Phing.html</link>
            <category>Deployment</category>
    
    <comments>http://codeinthehole.com/archives/13-Deploying-to-a-shared-hosting-environment-using-Phing.html#comments</comments>
    <wfw:comment>http://codeinthehole.com/wfwcomment.php?cid=13</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://codeinthehole.com/rss.php?version=2.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    

    <author>nospam@example.com (David Winterbottom)</author>
    <content:encoded>
    &lt;p&gt;
Deploying applications to shared hosting environments can be a pain when no SSH access is provided.  Consequently, it&#039;s hard to avoid using FTP to deploy files from your development environment to a production server.   In such trying circumstances, it&#039;s easy to form self-destructive habits like using drag-and-drop FTP deployment - a very bad thing.  Much better is to write an automated deployment script so that you can build to production in one clean step, a key tenet of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.joelonsoftware.com/articles/fog0000000043.html&#039;);&quot;  href=&quot;http://www.joelonsoftware.com/articles/fog0000000043.html&quot; title=&quot;The Joel Test&quot;&gt;The Joel Test&lt;/a&gt; for writing better code (highly recommended).  Get deployment right at the start and making major changes to your application becomes trivial rather than a complete nightmare.&lt;/p&gt;
&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/&#039;);&quot;  href=&quot;http://phing.info/&quot; title=&quot;Phing homepage&quot;&gt;Phing&lt;/a&gt; is great for deploying PHP applications.  It&#039;s well documented, easy to use and extend, and works well with other libraries 
such as PHPunit.  Although it&#039;s not in&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/docs/guide/current/&#039;);&quot;  href=&quot;http://phing.info/docs/guide/current/&quot; title=&quot;Current docs&quot;&gt;the current docs for version 2.3.x&lt;/a&gt; there is a useful FTP task (FtpDeployTask.php) 
in Phing 2.3.3 that can be used to create a simple build script for deploying to shared hosting environments using FTP.  Syntax and usage
are trivial given a glance through the source code (/usr/share/php/phing/tasks/ext/FtpDeployTask.php on Ubuntu systems).&lt;/p&gt;
&lt;p&gt;Here&#039;s a simple build.xml deployment script for a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/codeigniter.com/&#039;);&quot;  href=&quot;http://codeigniter.com/&quot; title=&quot;CodeIgniter homepage&quot;&gt;CodeIgniter&lt;/a&gt; project that uses the FtpDeploy task:&lt;/p&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; ?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Shared hosting deployment&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;default&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-application-files&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;basedir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.host&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.example.com&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.port&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;21&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.username&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;user&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.password&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;password&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.dir&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;/public_html/&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.mode&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ascii&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- FILESETS --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;fileset&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;dir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.images&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;images/**/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;favicon.ico&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/fileset&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;fileset&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;dir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.application&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;system/application/**/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;css/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;js/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/fileset&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;fileset&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;dir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.system&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;system/**/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;exclude&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;system/application/**/*&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;index.php&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;robots.txt&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;include&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.htaccess&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/fileset&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- DEPLOYMENT TARGETS --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;message&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Copying fileset &#039;${deploy.fileset.refid}&#039; to ${ftp.host} in ${ftp.mode} mode&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;ftpdeploy&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;host&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.host}&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;port&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.port}&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;username&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.username}&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;password&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.password}&quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;dir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.dir}&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;mode&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${ftp.mode}&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;fileset&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;refid&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${deploy.fileset.refid}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/ftpdeploy&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-images&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;msg&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying image files&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy.fileset.refid&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.images&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;ftp.mode&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;binary&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;override&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-application-files&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;msg&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying application files&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy.fileset.refid&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.application&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-system-files&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;msg&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying system files&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy.fileset.refid&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;files.system&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-all&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-images&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-application-files&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-system-files&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/project&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;As we&#039;re forced into using clumsy, out-dated FTP (rather than the wonderful rsync) to copy the files onto the production server, 
each deployment overwrites existing files with the selected fileset and this can be quite time-consuming for large filesets as it often moves across a load of files that haven&#039;t changed. 
Using FTP, this is tricky to avoid and probably not worth the effort.  Instead, there are four separate deployment targets that only move specific subsets of the total application fileset
over to the production environment (split according to the standard CodeIgniter directory structure) - most of the time we only want to move
the &quot;files.application&quot; fileset across.  These targets make use of the extremely useful &quot;phingcall&quot; target which allows a 
parameterised &quot;deploy&quot; target to be created which takes a fileset id as an argument.&lt;/p&gt;
&lt;p&gt;
With the above build.xml in the root of your project, deploying to production is now as simple as:&lt;/p&gt;
&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&amp;gt; &lt;span style=&quot;color: #000066;&quot;&gt;cd&lt;/span&gt; /path/to/application/ &amp;amp;&amp;amp; phing deploy-all&lt;/div&gt;
&lt;p&gt;although most of the time the following suffices:&lt;/p&gt;
&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&amp;gt; &lt;span style=&quot;color: #000066;&quot;&gt;cd&lt;/span&gt; /path/to/application/ &amp;amp;&amp;amp; phing&lt;/div&gt;
&lt;p&gt;
Note that FtpDeploy.php has a dependency on the PEAR package Net_Ftp which can be trivially installed in the usual manner:&lt;/p&gt;
&lt;div class=&quot;bash&quot; style=&quot;text-align: left&quot;&gt;&amp;gt; sudo pear install Net_FTP&lt;/div&gt;
&lt;p&gt;
Of course, this script is overly simplistic and only works well with a single developer.  However, it would be easy to extend to team development by 
integrating with SVN so that the latest revision (or designated tag/branch) is checked out into a temporary directory before
being copied over to the production server.&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Preferably however, get shared hosting that provides SSH access (&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.nearlyfreespeech.net/&#039;);&quot;  href=&quot;https://www.nearlyfreespeech.net/&quot; title=&quot;NearlyFreeSpeech homepage&quot;&gt;nearlyfreespeech.net&lt;/a&gt; is great).  Then you can deploy in a more sophisticated manner using SVN exports or rsync.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 04 Jan 2009 20:18:50 +0000</pubDate>
    <guid isPermaLink="false">http://codeinthehole.com/archives/13-guid.html</guid>
    <category>code igniter</category>
<category>deployment</category>
<category>phing</category>

</item>

</channel>
</rss>