Upsource 做为一个代码审查工具, 有不少有益的特性.php
下载html
下载并解压到指定的文件夹java
目录树git
├── api
├── apps
├── backups # 备份目录
├── bin # 应用目录
├── conf # 配置文件
├── data
├── internal
├── launcher
├── lib
├── logs # 日志
├── sonarqube
└── temp # 临时文件
复制代码
可用命令github
命令的位置数据库
$ ./bin/upsource.sh
# 调用 help <command> 来查看详细
复制代码
configure : 配置 Upsource
start : 后台启动
run : 在当前命令行运行
status : 查看运行状态
stop : 中止
restart : 重启
rerun : 当前命令行从新运行
dump : 输出 debug info
kill : 杀死 upsource 进程
java : 管理java的路径
help <command> : 显示帮助信息
help <command name>
prints usage text for the specified command
复制代码
详细文档查看api
这里咱们运行浏览器
$ ./bin/upsource.sh start
Starting Upsource...
* Configuring JetBrains Upsource 2018.1
* Made default base-url 'http://macbook-pro-2.local:8080/' from hostname 'macbook-pro-2.local' and listen port '8080'
* JetBrains Upsource 2018.1 runtime environment is successfully configured
* Loading logging configuration from /Users/duoli/Downloads/upsource-2018.1.357/lib/ext/log4j.xml
* Redirecting JetBrains Upsource 2018.1 logging to /Users/duoli/Downloads/upsource-2018.1.357/logs/internal/services/bundleProcess
* Configuring Service-Container[bundleProcess]
* Configuring Bundle Backend Service
* Configuring Configuration Wizard
* Starting Service-Container[bundleProcess]
* Starting Bundle Backend Service
* Starting Configuration Wizard
* JetBrains Upsource 2018.1 Configuration Wizard will be available on [http://macbook-pro.local:8080?wizard_token=UwxfxNH1OxGS75l3DO9p] after start
Upsource is running
复制代码
根据在命令行显示的信息, 咱们打开这个地址 http://macbook-pro.local:8080?wizard_token=UwxfxNH1OxGS75l3DO9p
, 若是在服务器上bash
这里咱们点击 Set Up 来进行安装服务器
这里来配置访问的地址, 若是是外网, 这里的地址应该是域名, 局域网替换成 IP, 若是是本地则能够替换成 localhost, 这里我替换为 localhost
建立帐号密码
生成受权文件
进行安装
开始启动, 启动完成就能够登陆了
这里我只是在phpstorm 中进行测试的, 可是是支持全系的, 只不过对代码部分的支持可能不太完善
这里以 git 做为版本控制
配置基础信息
配置代码集成
其余两项的配置根据本身的喜爱来进行, 这里不进行详细描述. 这样咱们保存以后他就能够进行对项目初始化.
初始化完成后能够在项目中进行集成了.
Settings
-> 搜索 Plugin
-> Browse repositories
-> 搜索 upsource
安装并重启
重启以后在设置中搜索 UpSource
, 在 Connection
菜单中填写 Server Url
为安装完成访问的根目录. 点击 Test Connection
来进行填写帐号密码受权, 受权成功后咱们即可以在项目中使用了
设置完成后在右下角有个标识表明已经启动了 Upsource 服务
在这里咱们能够关联项目, 切换项目, 映射路径, 配置通知, 更改用户等信息
这样咱们就能够在IDE中进行代码的review 和标识了. 这里的标识和 upsource 系统中的显示的数据是实时同步的. 而且支持 @
某我的.
这里的这里的快捷键是 ctrl + alt + /
, 咱们选中指定的行, 填写 review 代码
填写以后就会在 IDE 行号旁边和编辑区 右上角 显示评论图标, 点击便可显示须要修改的内容, 并高亮指定的区域
一样在平台上也会存在这一项目
这里有几个技巧
支持 @
来指定人
支持标签标注
好了, 团队中开始试用..
Updating project : An error occurred during flushing data to database upsource
这里内存必须在 8G 以上, 不然会报上面的错误.
通常来说就是没有把这个用户添加到所属项目中.
这些标签能够同步到 IDE 中.
好比一个用户有多个git global标识, 多是不一样时期的用户的昵称, 这里能够识别为一个帐户, 更方便进行管理