I have been reading for a while and got a few answers, but I just need some more help.
I am trying to automatically deploy a website when a certain change set is committed to a branch, so I release my different versions from different branches. For example, there is a live branch that whenever is updated, the new change sets are merged into the the current live website.
My repository (on a Subversion version control system) is on the same server as the live server, so all I need to do is to transfer the files to a different directory.
I know I need to edit repo/hooks/post-commit file, and I have got this working, however I am not sure on the contents of this file to do what I need to do.
Do not use hooks for deployment purposes. Use build tool (Ant, Maven, whatever) and continuous integration tool (CruiseControl, CruiseControl.rb, Hudson, etc). Using hooks is just wrong because of the several reasons:
All you need to is to:
Personally I use Ant and CruiseControl.rb for the purpose you’ve described.
Here is the example of build script to deploy my changes over ftp protocol:
build.propertiesfile has following content:I would recommend spending some time to learn basics of build management (Ant) and continuous integration (CruiseControl) to perform deployment in a most appropriate fashion. Even though it might seem to be not what you requested and little bit more complex, it is a right thing to do.