當 Mantis 有張貼一個新的 Issue 時, 與這個 Issue 相關的 Subversion 更動紀錄可以自動回寫至 Mantis 這個 Issue 內的 Bug 筆記內.
cd /var/www/html/mantis/plugins/ wget https://github.com/mantisbt-plugins/source-integration/archive/master.zip unzip master.zip rm master.zip cd source-integration-master/ cp -a Source .. cp -a SourceSVN ..
openssl rand -hex 12
來產生 API Key (之後會用到)
cp -a /var/www/html/mantis/plugins/SourceSVN/post-commit.tmpl /var/www/svn/erptools/hooks/post-commit chmod a+x /var/www/svn/erptools/hooks/post-commit
vi /var/www/svn/erptools/hooks/post-commit
#!/bin/sh # Copyright (c) 2012 John Reese # Licensed under the MIT license REV="$2" URL="http://localhost/mantis/plugin.php?page=Source/checkin" PROJECT="erptools" API_KEY="xxxxxxxxxxxxxxxx" LOG_FILE=`mktemp /tmp/svn_${PROJECT}_${REV}_log.XXX` CURL=/usr/bin/curl ${CURL} -d "repo_name=${PROJECT}" -d "data=${REV}" -d "api_key=${API_KEY}" ${URL} >> ${LOG_FILE}
主要修改
curl -d "repo_name=erptools" -d "data=325" -d "api_key=xxxxxxxxxxxxxxxxxxxxxxxx" "http://localhost/mantis/plugin.php?page=Source/checkin"