MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

How to do auto commit through SVN Hook

0
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

<Location /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 <username>

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


















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

This challenge is listed under Open Source , Development & Implementations and Operating Systems Community

Related Posts:

Apache Subversion (SVN)

 

Ubuntu

 

SVN Hooking

 

Initiator

Aravinthan
Aravinthan
  Follow

I am passinate about IT & PHP , Let's do it

More posts by: Aravinthan Asokan

1 Suggestion

  1. 21 March 13
    0

    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>

    • Aravinthan 21 March 13

      Thanks you , it is working for me :)

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top