- cd /svn/[your project]/hooks
- cp post-commit.tmpl post-commit
- chmod 755 post-commit
- 編輯post-commit設定寄信工具
- 如果要顯示中文要在post-commit裡面加上 export LANG="en_US.UTF-8"
- commit-email.pl
- /[path of svn tools]/commit-email.pl "$REPOS" "$REV" receiver@yourdomain
- path of svn tools可以用 rpm -ql subversion-tools | grep commit-email.pl 查到
- mailer.py
- /[path of svn tools]/mailer.py "$REPOS" "$REV"
- path of svn tools可以用 rpm -ql subversion-tools | grep mailer.py 查到
- 設定mailer.py的config檔
- cd /[path of svn tools]
- cp mailer.conf.example mailer.conf
- 修改mailer.conf
如果要做到符合條件的commit才寄mail,請參考以下的mailer.conf。
[Project_1]
for_repos = (?P<Project_1>) # Project_1 是 repository name
for_paths = ^data($|/.*) # 最上層是 data 的目錄
to_addr = aaa@example.com, bbb@example.com
[Project_2]
for_repos = (?P<Project_2>)
for_paths = ^bin($|/.*)
to_addr = ccc@example.com, ddd@example
沒有留言:
張貼留言