Automatic mail notification for subversion in centos 7
To set up automatic mail notifications for Subversion (SVN) on CentOS 7, you'll need to configure the svnserve
daemon and the svnsync
command. Here's a step-by-step guide:
Prerequisites:
-
Install
svnserve
andsvnsync
packages:sudo yum install subversion
-
Create a new SVN repository (if you haven't already):
sudo svnadmin create /path/to/repo
Configure
svnserve
for mail notifications: -
Edit the
svnserve
configuration file:sudo nano /etc/subversion/svnserve.conf
Add the following lines at the end of the file:
mail-from = [email protected] mail-command = /usr/bin/mail -s "SVN Notification" %r
Replace
[email protected]
with the email address you want to use for notifications.
Configure svnsync
for mail notifications:
-
Create a new file for
svnsync
configuration:sudo nano /etc/subversion/svnsync.conf
Add the following lines:
sync-command = /usr/bin/svnserve --config-dir=/etc/subversion --sync %r sync-mail = /usr/bin/mail -s "SVN Notification" %r
Enable and start
svnserve
andsvnsync
services: -
Enable the
svnserve
service:sudo systemctl enable svnserve
-
Start the
svnserve
service:sudo systemctl start svnserve
-
Enable the
svnsync
service:sudo systemctl enable svnsync
-
Start the
svnsync
service:sudo systemctl start svnsync
Test the setup:
-
Make a change to your SVN repository (e.g., add a new file).
-
Verify that you receive an email notification with the subject "SVN Notification" and the commit message.
That's it! You should now receive automatic mail notifications for Subversion changes on your CentOS 7 system.