Tuesday, February 17, 2015

How to Create SVN Server and add Repository on Ubuntu Server



SVN Documentation

Svn server: 192.168.1.100
Base Directory: /opt/lampp/htdocs/sub
Subdirectories: - repos (contains all svn repos )
- data (used as a container during initial import)
- web ( extracted data from the repos is present here)

Packages Required

subversion
libapache2-svn (for apache)
rapidsvn (client side)

$ Creating svn repository

This is to be done 192.168.1.100 Server

# mkdir /opt/lampp/htdocs/sub/repos/<repo-name>   ( optional )

# svnadmin create /opt/lampp/htdocs/sub/repos/<repo-name>

$ Put data into 192.168.1.100:/opt/lampp/htdocs/sub/data/

Note : If You have initinal code to import in repository use this .
 
 Eg :
<192.168.1.100># rsync -av (project_source) 192.168.1.100:/opt/lampp/htdocs/sub/data/

<192.168.1.100># cd /opt/lampp/htdocs/sub/data

<192.168.1.100># svn import <project name> file:///opt/lampp/htdocs/sub/repos/<project name> -m "initial import <project name>"

<192.168.1.100># touch /opt/lampp/htdocs/sub/repos/<project name>/hooks/post-commit

<192.168.1.100># chmod 777 /opt/lampp/htdocs/sub/repos/<project name>/hooks/post-commit

<192.168.1.100># echo “svn export --force file:///opt/lampp/htdocs/sub/repos/(project name)/  /opt/lampp/htdocs/sub/web/<project name>/” > /opt/lampp/htdocs/sub/repos/<project name>/hooks/post-commit

$ To enable user authentication make these three entries in the file
<192.168.1.100># vim /opt/lampp/htdocs/sub/repos/<project name>/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd

$ To add username and password
<192.168.1.100># vim /opt/lampp/htdocs/sub/repos/<project name>/conf/passwd
  nirmal= nirmal@123


$ To configure globle svn options (Like ignoring particular files and folders)
<192.168.1.100># vim /etc/subversion/config
global-ignores = *.swf *.mkv *.flv .*.swp .git networkimage uploads


$ Start the svn server
<192.168.1.100># svnserve -d

1 comment:

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...