Why automatic deployment of PHP applications is important?

Gears

Credits: http://bit.ly/9seqXQ

There are many ways PHP applications are deployed on production servers. Some people use SCMs like Subversion to fetch latest revision of code. Others simply transfer the files via FTP, SSH or rsync. There is one problem with all of these approaches. They are error prone. File transfer is only part of the deployment process. If something needs to be configured, built or run afterwards it’s often performed manually.

Humans make mistakes

The more complicated your application is the more mistakes you can make. Changing the configuration, running scripts, building the model or wsdl files, migrating the database, clearing the cache. There are many points when something may go wrong. And if anything can go wrong, It will. Several times I experienced problems because someone overwrote the production configuration in the code repository. Information like database passwords couldn’t be even stored there. Configuring and checking the project each time is a donkey work. If you do it manually you are likely to make a mistake. There is just too much thinking involved which can be done beforehand.

Automation is repeatable

Automating the deployment process makes it repeatable. It enables you to test the update as many times you want before really going live. And when this moment finally comes you don’t have to think about needed actions anymore. Just run your scripts and wait till everything is done. No thinking involved. Projects vary and every one of them can have slightly different deployment process. Person responsible for deployment not always knows what steps should be involved during the update. Or even if he knows that than still he can make mistake. The more projects you work on the more visible the problem becomes.

Letting the process live with the project

Making your deployment process automated moves the responsibility of defining and maintaining it to the development team. They know the best what should be done while updating. At the end they are the ones who write the application. When something changes in the process developers are forced to update the deployment scripts. The process is no longer stored in their heads. It lives with the project and becomes permanent. They can get back to it after one year, fix a bug and deploy it easily. New team members can learn about the process just by reading the scripts.

Deployment tools

There are existing Open Source tools you can use for automatic deployment. Just to mention few: How do you deploy your PHP applications? Did you automate your process already?

PHP development manager in GOYELLO, focusing on delivering high quality software with clean and easily maintainable code. Follows best programming practices and use the best Open Source solutions. Big fan of symfony framework.