Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Thanks

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You'd need a Post-commit hook to update (cvs update) /var/www or wherever your DocumentRoot is.

Don't.

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.

share|improve this answer
    
Yes this is a dev server, it is available in intranet only. –  Dr Casper Black Jan 31 '11 at 10:42

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.