Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use post-commit hooks to copy committed files to a web directory from SVN?

My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code.

My current workflow:

  • Make changes to a file
  • Commit the file to the Subversion repository
  • Upload the file new over SFTP to the Apache public directory
  • View the changes in my web browser

I would be much happier if my workflow was like this:

  • Make changes to a file
  • Commit the file to the Subversion repository
  • In the background, Subversion puts a copy of the committed file into the Apache public directory
  • View the changes in my web browser

I have very little server admin experience, and any help or pointers are appreciated. I heard that post-commit hooks are what I need, and that I can write bash scripts to do this, but I'm not sure where to start and didn't really find anything after quite a lot of Googling.

Thank you!

like image 716
rmh Avatar asked Sep 26 '08 16:09

rmh


1 Answers

The "official" answer is here.

I'm managing a website in my repository. How can I make the live site automatically update after every commit?

like image 122
harpo Avatar answered Oct 02 '22 04:10

harpo