发布时间:2025-12-09 11:58:48 浏览次数:1
代码审查(Code Review)在日常的开发工作中可以提高质量,而且还是一个知识共享和指导的极好的平台。但是在日常工作中,总是会因为个别的小事把codereview这个看似很小的事情实则很重要的审查环节给“稍后再议”,Review Board的目标便是改变这个现状,它所提供的应用程序可以支持代码审查流程。在使用之后感觉还是值得推荐给大家的。
安装Reviewboard依赖python开发环境,下面我们开始尝试吧。。。。此处我们实验的版本是3.0.14
apt-get install python python-setuptools python-devapt install memcachedeasy_install python-memcachedsudo apt install apache2 libapache2-mod-wsgisudo a2enmod wsgi #/* 修改apache2的配置,让python mod处于enable状态 */apt install patchapt install mysql-server python-mysqldb libmemcache-dev #默认安装的是mysql-5.7sudo apt install patch subversion python-svnapt install libffi-devsudo apt install libssl-devpip install pillowapt-get install python-yamleasy_install reviewboard #安装reviewboard/etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld_safe]socket = /var/run/mysqld/mysqld.socknice = 0[mysqld]user = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockcharacter_set_server = utf8port = 3306basedir = /usrdatadir = /var/lib/mysqltmpdir = /tmplc-messages-dir = /usr/share/mysqlskip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 16Mthread_stack = 192Kthread_cache_size = 8myisam-recover-options = BACKUPquery_cache_limit = 1Mquery_cache_size = 16Mlog_error = /var/log/mysql/error.logexpire_logs_days = 10max_binlog_size = 100Mcreate 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.linkRoot Path = / (默认)Database Type = mysqlDatabase Name = reviewboardDatabase server = localhostDatabase username = reviewboardDatabase password = reviewboardConfirm password = reviewboardMemcached Server = localhost:11211 (默认)Username = admin (默认)Password = 密码Confirm Password = 密码E-mail = xxx@qq.comCompany/Organization = 随意Allow us to collect support data = n安装完成后的显示信息
Setting up support ... OK* The site has been installedThe site has been installed in /var/www/reviewboardSample configuration files for web servers and cron are availablein the conf/ directory.You need to modify the ownership of the following directories andtheir 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/dataFor more information, visit:https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/* Get more out of Review BoardTo enable PDF document review, enhanced scalability, GitHubEnterprise support, and more, download Power Pack at:https://www.reviewboard.org/powerpack/Your install key for Power Pack is:e65b089794f8ede728984df0235072b951df5702Support contracts for Review Board are also available:https://www.beanbaginc.com/support/contracts/systemctl enable memcachedsystemctl enable mysqlsystemctl enable apache2cd /etc/apache2/sites-availablecp /var/www/reviewboard/conf/apache-wsgi.conf reviewboard.confcd ../sites-enabledln -s ../sites-available/reviewboard.conf .a2ensite reviewboard修改配置目录权限
chown -R www-data /var/www/reviewboard/htdocs/media/uploadedchown -R www-data /var/www/reviewboard/datachown -R www-data /var/www/reviewboard/htdocs/media/extchown -R www-data /var/www/reviewboard/htdocs/static/extapache加载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 = ["*"]