gitbase 是一個很不錯的代碼分析工具,咱們能夠直接使用sql來分析團隊的代碼,如下是rpm 包的製做html
rpm 包的製做使用了fpm 一個簡單,方即可以跨平臺的軟件包製做工具linux
如下二進制文件是本身編譯的一個版本,修改了關於統計沒人代碼行數,默認文件64kb的問題,增長到了8M(實際不能太大)
參考:
https://github.com/rongfengliang/gitbase/releasesgit
說明,只添加了支持基於systemd 管理的系統 github
[Unit]
Description=gitbase for git
[Service]
Type=simple
User=root
Group=root
EnvironmentFile=-/etc/gitbase/gitbase
ExecStart=/usr/bin/gitbase-linux server $OPTIONS
Restart=always
LimitAS=infinity
LimitRSS=infinity
LimitCORE=infinity
LimitNOFILE=655360
[Install]
WantedBy=multi-user.target
EXPERIMENTAL_IN_MEMORY_JOIN=on
MAX_MEMORY_INNER_JOIN=1024
INMEMORY_JOINS=on
OPTIONS=" -p 3306 --host=0.0.0.0 -d /var/lib/gitbase "
配置說明
EXPERIMENTAL_IN_MEMORY_JOIN 以及MAX_MEMORY_INNER_JOIN 主要是加速的,使用基於內存的join 處理
加速運行,/var/lib/gitbase 爲 git 代碼存儲的位置sql
fpm -s dir -t rpm -n gitbase --rpm-os linux -v v0.24.0-rc2 \
./gitbase-linux=/usr/bin/ \
./gitcode=/var/lib/gitbase \
./gitbase.service=/usr/lib/systemd/system/gitbase.service \
./gitbase=/etc/gitbase/gitbase
fpm -s dir -t rpm -n gitbase --rpm-os linux -v v0.24.0-rc2 \
./gitbase-linux=/usr/bin/ \
./gitcode=/var/lib/gitbase \
./gitbase.service=/usr/lib/systemd/system/gitbase.service \
./gitbase=/etc/gitbase/gitbase
Package version 'v0.24.0-rc2' includes dashes, converting to underscores {:level=>:warn}
Created package {:path=>"gitbase-v0.24.0_rc2-1.x86_64.rpm"}
yum install -y gitbase-v0.24.0_rc2-1.x86_64.rpm
yum install -y gitbase-v0.24.0_rc2-1.x86_64.rpm
已加載插件:fastestmirror
正在檢查 gitbase-v0.24.0_rc2-1.x86_64.rpm: gitbase-v0.24.0_rc2-1.x86_64
gitbase-v0.24.0_rc2-1.x86_64.rpm 將被安裝
正在解決依賴關係
--> 正在檢查事務
---> 軟件包 gitbase.x86_64.0.v0.24.0_rc2-1 將被 安裝
--> 解決依賴關係完成
依賴關係解決
===============================================================================================================
Package 架構 版本 源 大小
===============================================================================================================
正在安裝:
gitbase x86_64 v0.24.0_rc2-1 /gitbase-v0.24.0_rc2-1.x86_64 43 M
事務概要
===============================================================================================================
安裝 1 軟件包
總計:43 M
安裝大小:43 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安裝 : gitbase-v0.24.0_rc2-1.x86_64 1/1
驗證中 : gitbase-v0.24.0_rc2-1.x86_64 1/1
已安裝:
gitbase.x86_64 0:v0.24.0_rc2-1
完畢!
systemctl start gitbasee
systemctl status gitbase -l
systemctl status gitbase -l
● gitbase.service - gitbase for git
Loaded: loaded (/usr/lib/systemd/system/gitbase.service; disabled; vendor preset: disabled)
Active: active (running) since 二 2019-10-29 21:02:10 CST; 3s ago
Main PID: 13979 (gitbase-linux)
Tasks: 6
Memory: 15.0M
CGroup: /system.slice/gitbase.service
└─13979 /usr/bin/gitbase-linux server -p 3306 --host=0.0.0.0 -d /var/lib/gitbase
10月 29 21:02:10 iZ2zeg7uro1snhd9wqmp2oZ systemd[1]: Started gitbase for git.
10月 29 21:02:10 iZ2zeg7uro1snhd9wqmp2oZ gitbase-linux[13979]: time="2019-10-29T21:02:10+08:00" level=error msg="could not find repositories, assuming non bare format" path=/var/lib/gitbase
10月 29 21:02:10 iZ2zeg7uro1snhd9wqmp2oZ gitbase-linux[13979]: time="2019-10-29T21:02:10+08:00" level=info msg="squash tables rule is enabled"
10月 29 21:02:10 iZ2zeg7uro1snhd9wqmp2oZ gitbase-linux[13979]: time="2019-10-29T21:02:10+08:00" level=info msg="server started and listening on 0.0.0.0:3306"
關於fpm 安裝的連接 http://www.javashuo.com/article/p-bcxrfcmc-eg.html架構
https://github.com/rongfengliang/gitbase-rpm
https://github.com/rongfengliang/gitbase
http://www.javashuo.com/article/p-bcxrfcmc-eg.html工具