Managing software deployments of your PHP applications I
Disclaimer: I've been doing mostly PHP and Zend Framework based projects in the past two years, but the information from this article is general and should be applicable to most setups — even to non PHP-based projects (to a certain extent).
Inspired by Padraic's posting spree the other week, here's another attempt to provide you with some hands-on usefulness. I'm all open for all feedback, and sorry for the length!
What is deployment and how do you manage deployments?
Software deployment is all of the activities that make a software system available for use.
... and goes on:
The general deployment process consists of several interrelated activities with possible transitions between them. These activities can occur at the producer site or at the consumer site or both. Because every software system is unique, the precise processes or procedures within each activity can hardly be defined.
In general, there are different approaches to software deployment. Most people are probably not aware of a deployment process at all. They edit files and push it live. In most cases, live (sometimes referred to as production environment) is the webhosting account — for consistency, the environments setup for larger projects also includes a development and staging environment.
Taking the facts into account, we can summarize those efforts into three cases:
- Deploym..? I'm a skilled surgeon and shell ninja! I like to edit all my files online!
- I have a local WAMP, MAMP or LAMP and then FTP the files online.
- We have a defined process and use SVN, PEAR, phing or similar.
Why should I manage deployments?
There are a few reasons as to why it's good for youTM to come up with a release schedule to manage your deployments.
- Establishing a release schedule allows you to project the time necessary to implement and test new features and items.
- Planning in advance also helps to meet the plan.
- A schedule enables code testing (and other QA measures) before it's live. For example, assuming the schedule says to release a new version every two weeks, the net time (ten business days) could be divided up into eight business days for development, and two business days for testing. (Adjust as needed!) Take note — the schedule excludes weekends!
- A release schedule helps the development team to avoid all those extra last-minute changes which break things and cause grey hair without feeling bad or guilty. The established practice and process has to be used by all people involved, and developers are not to blame if someone else forgets that.