Skip to content

Instantly share code, notes, and snippets.

@mauricioduarte01
Forked from dpmex4527/docker_svn-server.md
Last active July 29, 2023 17:20
Show Gist options
  • Select an option

  • Save mauricioduarte01/1b9958d7742f6f5902393df302914ae4 to your computer and use it in GitHub Desktop.

Select an option

Save mauricioduarte01/1b9958d7742f6f5902393df302914ae4 to your computer and use it in GitHub Desktop.
Set up SVN server on docker

SVN on docker!

Quick notes on setting up a lightweight SVN server that is accessible via http (WebDav) and the svn custom protocol (svn://).

credits to :

Pre-reqs

Steps

This guide uses a lightweight svn-server docker image called elleFlorio/svn-docker. To set up

  • 1 ) Create an svn-root volume to hold your svn-server repos on your docker host

    $ docker volume create svn-root
  • 2 ) Run the docker container and set your working directory to /home/svn

    $ docker run -dit --name svn-server -v svn-root:/home/svn -p 7443:80 -p 3690:3690 -w /home/svn elleflorio/svn-server
  • 3 ) Configure a username and password to access http protocol

    $ docker exec -t svn-server htpasswd -b /etc/subversion/passwd svnadmin <password>
  • 4 ) Verify that the svn services is up and showing 0 repos available

    $ svn info svn://localhost:3960/
    
    svn: E170013: Unable to connect to a repository at URL 'svn://localhost:3960'
    svn: E210005: No repository found in 'svn://localhost:3960'
  • 5 ) Log in to your svn server using URL: http://localhost:7443/svn. You should see an empty listing with "Collection of Repositories" string on top

  • 6 ) Create a test svn repo using svnadmin command. verify repo exsits both in command line and web page

    $ docker exec -it svn-server svnadmin create Test
    $ docker exec -it svn-server ls -al Test
    
    total 16
    drwxr-xr-x   8 primetheus  staff  272 Jun  7 15:22 .
    drwxr-xr-x   3 primetheus  staff  102 Jun  7 15:22 ..
    -rw-r--r--   1 primetheus  staff  246 Jun  7 15:22 README.txt
    drwxr-xr-x   6 primetheus  staff  204 Jun  7 15:22 conf
    drwxr-sr-x  15 primetheus  staff  510 Jun  7 15:22 db
    -r--r--r--   1 primetheus  staff    2 Jun  7 15:22 format
    drwxr-xr-x  11 primetheus  staff  374 Jun  7 15:22 hooks
    drwxr-xr-x   4 primetheus  staff  136 Jun  7 15:22 locks
    $ svn info svn://localhost:3960/Test
    
    Path: Test
    URL: svn://localhost:3960/Test
    Relative URL: ^/
    Repository Root: svn://localhost:3960/Test
    Repository UUID: 626ee621-fc48-49e1-8733-3f850e997e67
    Revision: 0
    Node Kind: directory
    Last Changed Rev: 0
    Last Changed Date: 2017-06-07 15:22:54 -0500 (Wed, 07 Jun 2017)

Load test subversion repo

Let's load a test SVN repository, located here.

  • Dump SVN repo to local Docker container
    $ docker exec -it svn-server sh -c "svnrdump dump https://svn.code.sf.net/p/ultrastardx/svn | gzip > /tmp/ultrastardx.dump.gz"
  • Create new repo to host code
    $ docker exec -it svn-server svnadmin create ultrastardx
  • Load in the SVN dump archive (make sure your dashes and quotes aren't funky here)
    $ docker exec -it svn-server sh -c "gunzip -c /tmp/ultrastardx.dump.gz | svnadmin load ultrastardx"
  • Check to see that repo has been loaded properly
    $ svn info svn://localhost:3690/ultrastardx
@mauricioduarte01
Copy link
Author

mauricioduarte01 commented Jul 29, 2023

Append:

svn info svn://xxxxxx (esto se encuentra en el servidor de svn) ?=svn://localhost/ultrastardx
git svn clone svn://xxxxx ?= git svn clone svn://localhost/ultrastardx
svn log -q svn://xxxxx | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors.txt

svn log -q svn://localhost/ultrastardx | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors.txt
filter only names: svn log | grep '^r[0-9]' | awk -F ' [|] ' '{print $2}' | sort | uniq

git svn clone http://my-project.googlecode.com/svn/
--authors-file=users.txt --no-metadata --prefix "" -s my_project

git svn clone svn://localhost/ultrastardx
--authors-file=authors.txt --no-metadata --prefix "" -s my_project

https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git

https://superuser.com/questions/130326/list-of-all-users-who-committed-to-a-svn-repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment