How to do auto commit through SVN Hook
Started on: 06 February 13
Participants: 1
I am using tortoise Subversion for my project. Below are my steps to configure SVN Server
First step i did configure SVN Server for my Ubuntu server with Web Access
sudo apt-get install subversion libapache2-svn
sudo svnadmin create /svn
vim /etc/apache2/mods-enabled/dav_svn.conf
The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn
# Uncomment this to enable the repository,
DAV svn
The SVNPath line should be set to the same place your created the repository with the svnadmin command.
# Set this to the path to your repository SVNPath /svn
The next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to… probably best to leave it at the default.
# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic
AuthName “Subversion Repositoryâ€
AuthUserFile /etc/apache2/dav_svn.passwd
To create a user on the repository use, the following command:
sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd
Note that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn’t recreate the file.
Example:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd user1 (only for first time user use -cm)
New password:
Re-type new password:
Adding password for user user1
if add mouse below command
sudo htpasswd -m /etc/apache2/dav_svn.passwd user2
Restart apache by running the following command:
sudo /etc/init.d/apache2 restart
Now if you go in your browser to http://www.server.com/svn, you should see that the repository is enabled for anonymous read access, but commit access will require a username.
If you want to force all users to authenticate even for read access, add the following line right below the AuthUserFile line from above. Restart apache after changing this line.
Require valid-user
After this step i need to auto update to my server . (hooking)
i tried in post-commit file
#!/bin/sh
cd /mypath && svn update
But not working , please help
First step i did configure SVN Server for my Ubuntu server with Web Access
sudo apt-get install subversion libapache2-svn
sudo svnadmin create /svn
vim /etc/apache2/mods-enabled/dav_svn.conf
The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn
# Uncomment this to enable the repository,
DAV svn
The SVNPath line should be set to the same place your created the repository with the svnadmin command.
# Set this to the path to your repository SVNPath /svn
The next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to… probably best to leave it at the default.
# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic
AuthName “Subversion Repositoryâ€
AuthUserFile /etc/apache2/dav_svn.passwd
To create a user on the repository use, the following command:
sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd
Note that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn’t recreate the file.
Example:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd user1 (only for first time user use -cm)
New password:
Re-type new password:
Adding password for user user1
if add mouse below command
sudo htpasswd -m /etc/apache2/dav_svn.passwd user2
Restart apache by running the following command:
sudo /etc/init.d/apache2 restart
Now if you go in your browser to http://www.server.com/svn, you should see that the repository is enabled for anonymous read access, but commit access will require a username.
If you want to force all users to authenticate even for read access, add the following line right below the AuthUserFile line from above. Restart apache after changing this line.
Require valid-user
After this step i need to auto update to my server . (hooking)
i tried in post-commit file
#!/bin/sh
cd /mypath && svn update
But not working , please help
This challenge is listed under
Open Source
, Development & Implementations
and Operating Systems
Community
Related Posts:
1 Suggestion
Please try this way, replace the /mypath to your flder path that want to auto update and replace <Your Username> and <Your Password> it will work
#!/bin/sh cd /mypath && svn update --username <Your Username> --password <Your Password>
Thanks you , it is working for me :)