What is the best way to make real-time files using subversion on a production server?

I currently have subversion installed, so when I make changes to the Eclipse PDT, I can commit the changes and they will be saved in the / home / administrator / Project File. This file has the / branch / tags and / trunk directories recommended by subversion. I have no problem downloading files to the repository correctly, but do I need "mv" files in Linux on / var / www to make them live on the server? Is there an automatic process for this that I am missing? I assume that we do not want the / var / www directory (which is in real time on the machine) storage, but I do not know.

+4
source share
5 answers

You can do svn export in your www directory. This will give you a β€œclean” version of your repo without .svn directories.

 cd /var/www svn export /home/administrator/MyProject/trunk MyProject 

Edit: adding some great ideas from the comments ...

Some options when you want to update the exported copy:

  • run svn export --force /home/...../ MyProject will stop it, complaining about overwriting existing files. This method will mean that if you delete the file from your repository, it will still remain in your www folder.
  • change the SVN command to export to a new directory every time:
    svn export /home/..../ MyProject_20081105
    and then create a symbolic link to this folder:
    ln -s MyProject_20081105 MyProject
    Just delete and recreate the symbolic link every time you "free". In this case, the export directory does not have to be in the www folder.
+7
source

You can simply check a copy of the repository in the / var / www folder and then run svn update on it whenever you need (or switch it to a new branch / tag, etc.).). Thus, you have one copy of the repository extracted on your local computer, where you make changes and updates, and the other on your web server.

Using the SVN repository also makes it possible to revert to earlier versions.

+2
source

You can also make a hook after the commit, which moves all files modified by the commit to the / var / www directory.

Here is an example written in python that uploads modified files to a remote host via ftp:

http://svn.haxx.se/dev/archive-2007-08/0287.shtml

+1
source

You probably want to remember what files you have in production at any given time, so save the "release" tag (for example, in / project / tags / release). When you want to make a release, copy your trunk. Then svn exports the release tag.

Or something.

0
source

I saw a lot of people here , and other forums talk about using Capistrano for deployment, but I have no personal experience with it.

0
source

All Articles