Linux(CentOS 6)安装boardreview1.7.1

最近要开始团队checkin代码,所以代码审查boardreview很重要,昨天把boardreview搭出来,svnhook那块还没有搞,不过这个简单了。

最关键的是两个问题:

1. boardreview是管理系统,所以依赖的东西特别多。Python必须要2.6以上。

2. sourceforge.net被墙了,所以有些东西在pypi上下载后安装就好了。

服务器是CentOS6,以下是步骤:

安装SVN

echo "for Centos5.5 x86_64bit"
echo "refer to: http://wiki.centos.org/HowTos/Subversion"

# install apache-svn module.
sudo yum install -y mod_dav_svn subversion

# start the httpd service.
sudo /sbin/service httpd restart
sudo /sbin/chkconfig httpd on

# modify the httpd conf
sudo vi /etc/httpd/conf.d/subversion.conf
echo "add to the end-of-file:"
cat<< END
<Location /repos>
    DAV svn
    SVNPath /var/www/svn/repos
    AuthType Basic
    AuthName "Subversion repos"
    AuthUserFile /etc/svn-auth-conf
    Require valid-user
</Location>
END

# create user, please input the password.
sudo htpasswd -cm /etc/svn-auth-conf winlin
# add a guest user for boardreview
sudo htpasswd -m /etc/svn-auth-conf guest

# add svn dir.
sudo mkdir -p /var/www/svn
sudo chown winlin /var/www/svn

# create repos
cd /var/www/svn
svnadmin create repos
sudo chown -R apache.apache repos

# restart apache
sudo /sbin/service httpd restart

安装boardreview

echo "for Centos6 x86_64bit. Centos5.5因为Python是2.4的,无法支持ReviewBoard。"
echo "refer to: http://www.reviewboard.org/docs/manual/dev/admin/installation/linux/"

##################################################################################
##################################################################################
echo "install mysql"
sudo yum install -y mysql-server
# set mysql user name to root, password to root.
mysqladmin -uroot -p"" password root
# create database.
mysql -uroot -proot
create database reviewboard character set utf8;
\q

##################################################################################
##################################################################################
echo "install docutils for python(docutils.sourceforge.net cannot access)"
#sudo easy_install docutils
wget http://downloads.sourceforge.net/project/docutils/docutils/0.10/docutils-0.10.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdocutils%2F%3Fsource%3Ddirectory&ts=1358306675&use_mirror=jaist
tar xf docutils-0.10.tar.gz
(cd docutils-0.10;sudo python setup.py install)

echo "install feedparser"
wget http://pypi.python.org/packages/source/f/feedparser/feedparser-5.1.3.tar.bz2#md5=6fb6372a1dc2f56d4d79d740b8f49f25
tar xf feedparser-5.1.3.tar.bz2
(cd feedparser-5.1.3;sudo python setup.py install)

echo "install python-setuptools python-devel memcached patch"
sudo easy_install -U setuptools
sudo yum install -y python-devel memcached
sudo easy_install python-memcached
sudo yum install -y patch
sudo easy_install ReviewBoard
sudo easy_install mysql-python

echo "install pysvn for centos, the INSTALL.html in pysvn-1.7.6.tar.gz"
sudo yum install -y subversion-devel
wget http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.6.tar.gz
tar xf pysvn-1.7.6.tar.gz
(cd pysvn-1.7.6; cd Source;python setup.py backport;python setup.py configure;make;)
# copy
PythonLib="/usr/lib64/python2.6/site-packages/pysvn"
sudo mkdir -p ${PythonLib}
sudo cp pysvn-1.7.6/Source/pysvn/__init__.py ${PythonLib}
sudo cp pysvn-1.7.6/Source/pysvn/_pysvn*.so ${PythonLib}

##################################################################################
##################################################################################
echo "install mod_wsgi"
sudo yum install -y mod_wsgi

site=review.winlin.com
echo "create reviewboard site: ${site}"
echo "refer to: http://www.reviewboard.org/docs/manual/dev/admin/installation/creating-sites/#creating-sites"
# web: admin, admin
# mysql-db: root, root
rb-site install /var/www/${site}
sudo chown -R apache /var/www/${site}/htdocs/media/uploaded
sudo chown -R apache /var/www/${site}/htdocs/media/ext
sudo chown -R apache /var/www/${site}/data
# copy conf
sudo cp /var/www/${site}/conf/apache-wsgi.conf /etc/httpd/conf.d/${site}.conf

# restart apache
sudo /sbin/service httpd restart

echo "set hosts:"
echo "192.168.11.222 review.winlin.com"
echo "open in browser:"
echo "http://review.winlin.com"

##################################################################################
##################################################################################
# create review request.
sudo easy_install -U RBTools

# update svn property
echo "set hosts:"
echo "192.168.11.222 review.winlin.com"
sudo vi /etc/hosts
# checkout the repos
svn co http://review.winlin.com/repos
cd repos/
svn propset reviewboard:url http://review.winlin.com .
svn ci -m "update reviewboard url"
# do some changes.
# for example, change code.
# then use post-review to submit review.
# --target-group sepcifies the users to review.
# --description specifies the description of review, required by publish.
# --publish if not publish, it's a draft and we must publish it manually.
post-review --summary="support more AMF0 codec" --target-group=reviewer --description="update amf0" --publish --username=winlin --password=winlin

相关推荐