Mac搭建review 代码工具Gerrit + Gitlab

Mac系统 搭建代码review工具 Gerrit + Gitlab


比较适合Java开发做代码review

一、安装前的 准备工作

1.已经安装JDK【1.7/1.8】
2.已经安装 mysql
3.nginx
4.git

二、安装Gerrit

官网Gerrit下载地址:https://www.gerritcodereview.com/

1.先创建gerrit启动过程需要的数据库

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 35
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT USER();
+----------------+
| USER()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> create database reviewdb;
Query OK, 1 row affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on reviewdb.* to zhanghuilong@localhost identified by 'zhanghuilong';
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| reviewdb           |
| sys                |
+--------------------+
8 rows in set (0.01 sec)

mysql>
 

2.安装gerrit
除了设置 http的那个稍微注意点,其他可以一路回车键按下去。后面还可以更改gerrit.config 配置

# init -d review_site 中的文件名称可以自定义
huilong-MackPro:~ zhanghuilong$ java -jar Downloads/gerrit-2.15.3.war init -d review_site
Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
[2018-09-18 14:37:03,839] [main] INFO  com.google.gerrit.server.config.GerritServerConfigProvider : No /Users/zhanghuilong/review_site/etc/gerrit.config; assuming defaults

*** Gerrit Code Review 2.15.3
*** 

Create '/Users/zhanghuilong/review_site' [Y/n]? Y #创建文件夹

*** Git Repositories
*** 

Location of Git repositories   [git]: GerritResource #GerritResource后续git项目仓库位置

*** SQL Database
*** 

Database server type           [h2]: mysql #根据自己本机安装的数据库进行设置,我本地是mysql

Gerrit Code Review is not shipped with MySQL Connector/J 5.1.43
**  This library is required for your configuration. **
Download and install it now [Y/n]? Y
Downloading https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.43/mysql-connector-java-5.1.43.jar ... OK
Checksum mysql-connector-java-5.1.43.jar OK
Server hostname                [localhost]: 
Server port                    [(mysql default)]: 
Database name                  [reviewdb]: # 数据库名称 
Database username              [zhanghuilong]: root # 我本地用户名为root,所以这里更改为:root
root's password                :  #输入数据库访问密码
              confirm password :  #确认密码

*** NoteDb Database
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值