Subversion Partial Export

后端 未结 8 1506

I have somewhat interesting development situation. The client and deployment server are inside a firewall without access to the Subversion server. But the developers are out

相关标签:
8条回答
  • 2021-01-03 06:34

    I've found rsync extremely useful for synchronizing directory trees across multiple systems. If you have shell access to your server from a development workstation, you can regularly check out code locally and run rsync, which will transfer only the files that have changed to the server.

    (This assumes a Unix-like environment on your development workstations. Cygwin will work fine.)

    cd deploy
    svn update
    rsync -a . server:webdir/
    

    Your question sounds like you don't actually have any direct network access from your development workstations to your server, and what you're really looking for is a way to get Subversion to tell you which files have changed. svn export supports an argument to let you check out only the files that changed between particular revisions. From the svn help:

      -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                                 A revision argument can be one of:
                                    NUMBER       revision number
                                    '{' DATE '}' revision at start of the date
                                    'HEAD'       latest in repository
                                    'BASE'       base rev of item's working copy
                                    'COMMITTED'  last commit at or before BASE
                                    'PREV'       revision just before COMMITTED
    

    You'll need to keep track of what the latest revision you copied to the server. Assuming it's SVN revision xxxx:

    svn export -r xxxx:HEAD http://svn/
    

    Then simply copy the contents of the deploy directory to your server on top of the existing files.

    This won't handle deleted files, which may prove problematic in some environments.

    0 讨论(0)
  • 2021-01-03 06:39

    If you tag the revisions this may help github svn-diff-export

    0 讨论(0)
  • 2021-01-03 06:43

    The Subversion hooks looks like it has a lot of promise. But being relatively uninformed about how to script the hook, how would I pull out the files that were committed and FTP them somewhere maintaining the directory structure?

    If I could do that, then someone inside the firewall can pull the files down to the deployment server and we'd be good to go.

    0 讨论(0)
  • 2021-01-03 06:45

    You don't provide information on what is allowed through the firewall. I'm not familiar with UnleashIT.

    I guess you could have a script that exports from SVN to a folder on the SVN server. The script then zips the exported files. You can then transport the ZIP file however you want and extract to the deployment server.

    TortoiseSVN supports proxy servers so you could use one of those from the client's side?

    0 讨论(0)
  • 2021-01-03 06:46

    So if I understand correctly...

    Let's say you have a repository that looks like this:

    /
    |+-DIR1
    |   |- FILEa
    |   |- FILEb
    |+-DIR2
    |   |- FILEc
    |   |- FILEd
    |- FILEe
    |- FILEf
    

    And let's say you update files FILEa, FILEc, and FILEf and commit them back into the repository. Then what you want to export out of the repository is a structure that looks like this:

    /
    |+-DIR1
    |   |- FILEa
    |+-DIR2
    |   |- FILEc
    |- FILEf
    

    Is that right?

    0 讨论(0)
  • 2021-01-03 06:46

    You just want the people who are behind the firewall to be able to access the latest files committed to Subversion, right?

    Could you write an svn hook script that uses some method (maybe scp or ftp) to send the files over to the remote location at the time they're committed?

    0 讨论(0)
提交回复
热议问题