views:

63

answers:

1

On http://www.slideshare.net/eljefe/automated-deployment-with-phing in slide 15 they are talking about "locking the live site" when doing deployment.

We are running multiple webshops in a SAAS application where it is possible that users are adding products, buying products and paying for products online, and so on...

When deploying we want to do this as clean as possible, so that not payments or orders or other critical data will be lost.

We have a deployment scenario set up using phing (amazing tool!) but we are missing one crucial step being the "locking of the live site" while deploying.

What is a possible way to lock a live site and bring it back online after deploying?

+1  A: 

You could create a task that creates (or deploys) a maintenance page (hTML) and the accompanying .htaccess file to redirect all requests to it. Then do the rest of your deployment. Finally replace the .htaccess file with the regular version and you are done.

There is a nice example in the book Expert php 5 tools from packt.

https://www.packtpub.com/expert-php-5-tools/book

HTH, Steve

Steve Robillard
thanks Steve. What will happen when someone is paying an order in one of our shops on PayPal when we start deploying? Normally, after the Paypal transaction has been confirmed, we would confirm and create the order for the shop admin, but now this person would pay on paypal and see the redirect maintenance html instead of getting the order confirmation page. Also, the order would seem "lost"?
Jorre
You could control who gets the maintenance page by ip or domain name so you should be able to detect the redirect from paypal. Since you are talking about an ecommerce solution (something not included in your original question). You may want to give plenty of notice and lock the site to new orders. you could then check your db for open sessions or pending transactions, once these are complete you could then show the maintenance page to everyone.
Steve Robillard
At the very least you could add text to the maintenance page that you are doing maintenance and that they will be able to log in and retrieve their order shortly (I am assuming an electronic downloadable product).
Steve Robillard
You may also want to look at using symlinks to deploy your app to minimizre the time the switch to a new version takes.
Steve Robillard
perfect answer to my questions, thanks a lot!
Jorre