0

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

Dr Casper Black
  • 605
  • 1
  • 7
  • 12

2 Answers2

1

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.

Tom O'Connor
  • 27,440
  • 10
  • 72
  • 148
1

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)

lynxman
  • 9,157
  • 3
  • 24
  • 28