I have a CVS on Debian and apache/PHP/MySql. I remember when i worked in a team over the net a wile ago, that after commit i could see the changes on the web server in the php application.
How can I achieve this?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
You'd need a Post-commit hook to update (
/var/www or wherever your DocumentRoot is.
If it's not a development server only, then it's an exceptionally bad idea. It only takes a second to commit non-working code, then you're website's buggered.
The smart play in this situation, I think, is to use something like Hudson CI server, and run a bunch of PHP tests, with lint, PHPUnit and Selenium before updating the DocumentRoot with new code.
Another valid option is only to allow the DocumentRoot to be updated if the latest release is "tagged", so that the tagging is a manual process, and only takes place after the code has been reviewed / tested.
This can be done by having a script to automatically publish your repo to the web server every X minutes, this script should only check that changes have happened to the repository and proceed to deploy it.
This is very useful for development scenarios, be aware though that automatic deployment is really not recommended for prod (I know you're not asking for that, it's just a recommendation)