1. 程式人生 > >Apache+SVN+Review Board代碼審核服務器搭建流程

Apache+SVN+Review Board代碼審核服務器搭建流程

代碼審核

Apache+SVN+Review Board代碼審核服務器搭建流程

一、簡介

代碼審查(CodeReview)不但可以提高質量,而且還是一個知識共享和指導的極好的手段。ReviewBoard是一款比較優秀的,開源的基於WEB的代碼審查工具。

二、準備工作

2.1、安裝依賴包

yum -y install gcc gcc-c++ make cmake autoconfautomake libffi libffi-devel ncurses* bison* zlib* expat* openssl* apr* neon*


2.2、安裝Apache

yum -y install httpd httpd-devel


2.3、安裝MySQL

yum -y install mysql mysql-server mysql-devel mysql-python
service mysqld start


登錄MySQL創建reviewboard數據庫和reviewboard用戶

mysql –uroot –p
>create database reviewboard default charset utf8collate utf8_general_ci;
>grant all on reviewboard.* [email protected] identified by ‘reviewboard‘;


2.4、安裝memcached

yum -y install memcached python-memcached
service memcached start


2.5、安裝patch

yum -y install patch


2.6、安裝Python

yum -y install python python-devel


2.7、安裝python-subvertpy pysvn

如果python版本為2.6CentOS6.x),可以采用EPEL yum源進行下載

(1)、
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y installpython-subvertpy pysvn

(安裝yumEPEL紅帽企業庫,centos默認yum源庫中沒有pysvn


(2)、
yum --enablerepo=epel install pysvnpython-subvertpy

(指定在EPEL yum源中,下載pysvnpython-subvertpy

CentOS7.x 安裝EPEL

rpm -ivhhttp://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


三、開始安裝

3.1、安裝easy_install

distribute0.7版本後就和setuptools合並在一起了,所以先刪除舊版(setuptoolseasy_install

第一步:刪除easy_install

rm -f /usr/bin/easy_install*
rm -f /usr/local/bin/easy_install*


第二步:安裝distribute

wget https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
python distribute_setup.py
rm distribute_setup.py


3.2、安裝ReviewBoard

easy_install reviewboard
rb-site install /var/www/html/reviewboard


根據情況配置以下內容

Domain Name: 192.168.2.41
Root Path [/]:
Database Type: mysql
Database Name [reviewboard]:
Database Server [localhost]:
Database Username: reviewboard
Database Password: 
Confirm Database Password:
Memcache Server [localhost:11211]:
Username [admin]: admin
Password: 
Confirm Password: 
E-Mail Address: [email protected]
Company/Organization Name (optional): unilifemedia
Allow us to collect support data? [Y/n]:


3.3、配置reviewboard目錄權限

chown -R apache.apache/var/www/html/reviewboard/htdocs/
chown -R apache.apache /var/www/html/reviewboard/data


3.4、配置reviewboard

apache-wsgi.conf配置文件放到Apacheconf.d目錄下

cp /var/www/html/reviewboard/conf/apache-wsgi.conf/etc/httpd/conf.d/


配置允許訪問reviewboard的域名或IP

vi/var/www/html/reviewboard/conf/settings_local.py

ALLOWED_HOSTS =[‘192.168.2.41‘,‘codereviewboard.unilifemedia.com‘]


重啟Apache

service httpd restart


四、後臺配置

登錄:http://192.168.2.41/

輸入剛才配置的admin密碼

技術分享

4.1、進入管理員後臺

技術分享

4.2、配置發送郵件

技術分享

4.3、配置審核代碼倉庫

技術分享


輸入名稱,SVN倉庫地址,用戶名密碼。

技術分享

4.4、添加用戶

技術分享

技術分享



Apache+SVN+Review Board代碼審核服務器搭建流程