I have noticed a few times earlier on different sites an index pages with title “Please be patient, while we are deploying new software version. You’ll like it”. And one day, I decided that it is the time, to integrate the similar feature to our automated deployment process.
I think, that this page has to show user some indication of action progress(real or fictional), not just a static page, user has to refresh to see if it is finished or not. What user has to do – is just open once the site, see the message, that it is “Under construction”, and stay the page for a while.
It has to refresh itself until the time, deployment has finished. After that it has to load index page of new version’s website.
I wan’t to tell you, how and when this new index page is setting up. Right, all the deployment processes can vary a lot depending on the software it deploys, environment it uses, deployment tools etc.

What is highly recommended in most cases:
1. Install new index page with “Under construction” message
2. block all the web site’s pages, except index
== different actions here(DB updates, server restart, caching refresh etc.) ==
3. unblock all the pages(except index)
4. delete “Under construction” page
That is how, I did it:
It is an Apache Ant build file, with the following contents:
<project name=“Under construction page” basedir=“.”>
<target name=“show-splash-screen-while-deployment”>
<exec executable=“cp”>
<arg value=“.htaccess”/>
<arg value=“.htaccess-backup”>
</exec>
<exec executable=“cp”>
<arg value=“.htaccess-block-all-except-index”>
<arg value=“.htaccess”/>
</exec>
</target>
<target name=“hide-splash-screen-while-deployment”>
<exec executable=“mv”>
<arg value=“.htaccess-backup”>
<arg value=“.htaccess”>
</exec>
</target>
</project>
To install our “Under construction” page – just run:
It will backup your default .htaccess file, and replace it with new one, which catches all the queries and redirect it to the root of the web site.
And when deployment will be finished, run:
It will restore your default .htaccess file.
In attachment, you can find all those files you need to do the same.
That solution is not the best, and is not for types of projects.If you like the idea, mostly you’ll need to modify it to your demands and your environment.
Have fun!
Tags: apache ant, Deployment, process, under contstuction

