代码审查(Code Review)在日常的开发工作中可以提高质量,而且还是一个知识共享和指导的极好的平台。但是在日常工作中,总是会因为个别的小事把codereview这个看似很小的事情实则很重要的审查环节给“稍后再议”,Review Board的目标便是改变这个现状,它所提供的应用程序可以支持代码审查流程。在使用之后感觉还是值得推荐给大家的。
安装Reviewboard依赖python开发环境,下面我们开始尝试吧。。。。此处我们实验的版本是3.0.14
apt-get install python python-setuptools python-dev
apt install memcached
easy_install python-memcachedsudo apt install apache2 libapache2-mod-wsgisudo a2enmod wsgi #/* 修改apache2的配置,让python mod处于enable状态 */apt install patch
apt install mysql-server python-mysqldb libmemcache-dev #默认安装的是mysql-5.7sudo apt install patch subversion python-svn
apt install libffi-devsudo apt install libssl-dev
pip install pillow
apt-get install python-yaml
easy_install reviewboard #安装reviewboard
/etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
character_set_server = utf8
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover-options = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
create database reviewboard default charset utf8 collate utf8_general_ci;
create user 'reviewboard'@'localhost' identified by '$passwd'; #-- 其中reviewboard为用户名grant all on reviewboard.* to 'reviewboard'@'localhost'; #-- 前一个reviewboard为数据库名,后一个reviewboard为用户名
root@reviewboard-10-243:~# rb-site install /var/www/reviewboardDomain = reviewboard.xsl.link
Root Path = / (默认)
Database Type = mysql
Database Name = reviewboard
Database server = localhost
Database username = reviewboard
Database password = reviewboard
Confirm password = reviewboard
Memcached Server = localhost:11211 (默认)
Username = admin (默认)
Password = 密码
Confirm Password = 密码
E-mail = xxx@qq.com
Company/Organization = 随意
Allow us to collect support data = n
安装完成后的显示信息
Setting up support ... OK
* The site has been installed
The site has been installed in /var/www/reviewboard
Sample configuration files for web servers and cron are available
in the conf/ directory.
You need to modify the ownership of the following directories and
their contents to be owned by the web server:
* /var/www/reviewboard/htdocs/media/uploaded
* /var/www/reviewboard/htdocs/media/ext
* /var/www/reviewboard/htdocs/static/ext
* /var/www/reviewboard/data
For more information, visit:
https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/
* Get more out of Review Board
To enable PDF document review, enhanced scalability, GitHub
Enterprise support, and more, download Power Pack at:
https://www.reviewboard.org/powerpack/
Your install key for Power Pack is:
e65b089794f8ede728984df0235072b951df5702
Support contracts for Review Board are also available:
https://www.beanbaginc.com/support/contracts/
systemctl enable memcached
systemctl enable mysql
systemctl enable apache2
cd /etc/apache2/sites-available
cp /var/www/reviewboard/conf/apache-wsgi.conf reviewboard.confcd ../sites-enabled
ln -s ../sites-available/reviewboard.conf .
a2ensite reviewboard
修改配置目录权限
chown -R www-data /var/www/reviewboard/htdocs/media/uploaded
chown -R www-data /var/www/reviewboard/data
chown -R www-data /var/www/reviewboard/htdocs/media/ext
chown -R www-data /var/www/reviewboard/htdocs/static/ext
apache加载reviewboard
sudo a2dissite 000-defaultsudo a2ensite reviewboardsudo /etc/init.d/apache2 reloadsudo /etc/init.d/apache2 restart
通过浏览器访问reviewboard需要在reviewboard中允许外部网络访问,配置文件为:/var/www/reviewboard/conf/settings_local.py
ALLOWED_HOSTS = ["localhost"] 修改成 ALLOWED_HOSTS = ["*"]