2018년 4월 29일 일요일

[Automate Build] 1. Set up SVN Server on Docker

1. Set up SVN Server on Docker
I set up svn server on docker
(SVN server in my company is on the macOS, but it's not matter.)
Install svn server and make repository
# mkdir -p /share/docker/svn-server/svn-root

# docker run --name svn-server \
           --detach \
           --volume /share/docker/svn-server/svn-root:/var/opt/svn \
           --publish 3690:3690 \
           garethflowers/svn-server

# docker ps
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                           PORTS                    NAMES
a95a445b29c8        garethflowers/svn-server   "/usr/bin/svnserve -…"   3 seconds ago       Up 1 second (health: starting)   0.0.0.0:3690->3690/tcp   svn-server

# docker exec -it svn-server svnadmin create test-repo

# docker exec -it svn-server svnadmin info test-repo
Path: test-repo
UUID: 16f1dd00-4a5d-44f2-adcb-24c03d1b441e
Repository Format: 5
Compatible With Version: 1.9.0
Repository Capability: mergeinfo
Filesystem Type: fsfs
Filesystem Format: 7
FSFS Sharded: yes
FSFS Shard Size: 1000
FSFS Shards Packed: 0/0
FSFS Logical Addressing: yes
Configuration File: test-repo/db/fsfs.conf

Go to container's CLI to set config or add users
# docker exec -it svn-server sh

1-2. Add svn users
# vi /var/opt/svn/test-repo/conf/passwd
### This file is an example password file for svnserve.
...
[users]
# harry = harryssecret
# sally = sallyssecret
seunghyun = 1234567
* Caution : hot key 'shift+Q' doesn't work, use ':' + 'wq'

# vi /var/opt/svn/test-repo/conf/authz
### This file is an example authorization file for svnserve.
...
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
default = seunghyun

# [/foo/bar]
# harry = rw
# &joe = r
# * =

[/]
@default = rw

...
* Caution : hot key 'shift+Q' doesn't work, use ':' + 'wq'

# vi /var/opt/svn/test-repo/conf/svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
...
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
* Caution : hot key 'shift+Q' doesn't work, use ':' + 'wq'