前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CodeReview之reviewboard快速入门

CodeReview之reviewboard快速入门

作者头像
公众号: 云原生生态圈
发布2021-11-15 17:31:33
1.2K0
发布2021-11-15 17:31:33
举报
文章被收录于专栏:云原生生态圈

在ubuntu16.04上部署reviewboard

代码审查(Code Review)在日常的开发工作中可以提高质量,而且还是一个知识共享和指导的极好的平台。但是在日常工作中,总是会因为个别的小事把codereview这个看似很小的事情实则很重要的审查环节给“稍后再议”,Review Board的目标便是改变这个现状,它所提供的应用程序可以支持代码审查流程。在使用之后感觉还是值得推荐给大家的。

安装Reviewboard依赖python开发环境,下面我们开始尝试吧。。。。此处我们实验的版本是3.0.14

python环境的安装

代码语言:javascript
复制
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

数据库配置

编辑mysql配置文件

/etc/mysql/mysql.conf.d/mysqld.cnf

代码语言:javascript
复制
[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

创建数据库并授权访问用户

代码语言:javascript
复制
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为用户名

初始化配置reviewboard

代码语言:javascript
复制
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

安装完成后的显示信息

代码语言:javascript
复制
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/

开机自启服务

代码语言:javascript
复制
systemctl enable memcached
systemctl enable mysql
systemctl enable apache2

apache中配置reviewboard的配置文件

代码语言:javascript
复制
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

修改配置目录权限

代码语言:javascript
复制
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

代码语言:javascript
复制
sudo a2dissite 000-defaultsudo a2ensite reviewboardsudo /etc/init.d/apache2 reloadsudo /etc/init.d/apache2 restart

访问reviewboard

通过浏览器访问reviewboard需要在reviewboard中允许外部网络访问,配置文件为:/var/www/reviewboard/conf/settings_local.py

代码语言:javascript
复制
ALLOWED_HOSTS = ["localhost"] 修改成 ALLOWED_HOSTS = ["*"]

openldap集成reviewboard

reviewboard中配置邮箱组参考链接

  • 安装文档
  • 官方demo演示
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2019-08-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 云原生生态圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 在ubuntu16.04上部署reviewboard
    • python环境的安装
      • 数据库配置
        • 编辑mysql配置文件
        • 创建数据库并授权访问用户
      • 初始化配置reviewboard
        • 开机自启服务
          • apache中配置reviewboard的配置文件
            • 访问reviewboard
              • openldap集成reviewboard
                • reviewboard中配置邮箱组参考链接
                相关产品与服务
                云数据库 SQL Server
                腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档