Version Control: SVN, PHP and MySQL

Recently I checked out Flickr’s versioning theory by Cal Handerson, so it is almost like my current deployment progress, but with some differences….
I’ve used on many projects Subversion. It works perfect combined with staging at 3 levels:
- dev
- staging (testing area)
- public area (the final, user visible web directory)

Working on 3 levels with PHP projects is almost perfect, except 2 things:
1. Web Tests
2. DB Changes

This is hard to be handled by SVN or CVS, but using a good PHP Framework with defined vartypes parameters on any of the controller & model, can do automatic testing and also we will need to write alot of web tests, but this is realy needed if we want to have a working app :)

About the DB changes, there are alot of tools for mysql and any of the other RDBMSes, but in most cases they doesnt work as they has to (i mean generaly mysql or maybe i didnt found the right tool). So here is maybe a good idea to create an RDBMS backend seperated with an web app for creating changes to the DB, then we log them and add them to the SVN.

So in few words, how to finish all those ‘baby steps’ into a good version control system with testing:
1. When a new version is done in the dev we deploy it to staging.
2. When staging is deployed, we run web tests and automatic tests.
3. Run DB tests (sync cloned production db with the changes and verify its integrity)
4. If everything is ok….move to the public area :)

blog comments powered by Disqus