centos7部署git_stats代码统计分析工具

少年辛苦终身事,莫向光阴惰寸功。这篇文章主要讲述centos7部署git_stats代码统计分析工具相关的知识,希望能为你提供帮助。
一、简介
当前git_stats所生成统计信息分为如下几类:
【centos7部署git_stats代码统计分析工具】

  • 通用统计:总的文件数、行数、提交数、创建人数;
  • 活动统计:按一天中的每个小时统计、按一周中的明天统计、按一星期中的每小时统计、按一年中的每月统计、按年和月统计、按年统计;
  • 创建人统计:统计创建人信息,包括首次提交日期、最后提交日期等,按月统计提交人信息、按年统计提交人信息;
  • 文件统计:按日期和扩展统计文件;
  • 行数统计:按日期统计文件行数;


二、安装部署
1.查看当前ruby 版本
ruby -v

#若无安装,直接yum 安装,后续在升级ruby版本,否则不需要
yum install ruby -y

2.添加ruby国内阿里云仓库
#查看当前仓库地址
gem sources -l
#配置阿里云仓库源
gem sources -a http://mirrors.aliyun.com/rubygems/ --remove https://rubygems.org/

3.安装RAM管理工具由于服务器访问不到hkp://keys.gnupg.net.
使用下面脚本rvm_install 即可安装。
sh rvm_install.sh

#!/usr/bin/env bash

shopt -s extglob
set -o errtrace
set -o errexit
set -o pipefail

rvm_install_initialize()

DEFAULT_SOURCES=(github.com/rvm/rvm bitbucket.org/mpapis/rvm)

BASH_MIN_VERSION="3.2.25"
if
[[ -n "$BASH_VERSION:-" & &
"$(\\printf "%b" "$BASH_VERSION:-\\n$BASH_MIN_VERSION\\n" | LC_ALL=C \\sort -t"." -k1,1n -k2,2n -k3,3n | \\head -n1)" != "$BASH_MIN_VERSION"
]]
then
echo "BASH $BASH_MIN_VERSION required (you have $BASH_VERSION)"
exit 1
fi

export HOME PS4
export rvm_trace_flag rvm_debug_flag rvm_user_install_flag rvm_ignore_rvmrc rvm_prefix rvm_path

PS4="+ \\$BASH_SOURCE##\\$rvm_path:- : \\$FUNCNAME[0]:+\\$FUNCNAME[0]()\\$LINENO > "


log()printf "%b\\n" "$*";
debug() [[ $rvm_debug_flag:-0 -eq 0 ]] || printf "%b\\n" "$*" > & 2;
warn()log "WARN: $*" > & 2 ;
fail()fail_with_code 1 "$*" ;
fail_with_code()code="$1" ; shift ; log "\\nERROR: $*\\n" > & 2 ; exit "$code" ;

rvm_install_commands_setup()

\\which which > /dev/null 2> & 1 || fail "Could not find which command, make sure its available first before continuing installation."
\\which grep > /dev/null 2> & 1 || fail "Could not find grep command, make sure its available first before continuing installation."
if
[[ -z "$rvm_tar_command:-" ]] & & builtin command -v gtar > /dev/null
then
rvm_tar_command=gtar
elif
$rvm_tar_command:-tar --help 2> & 1 | GREP_OPTIONS="" \\grep -- --strip-components > /dev/null
then
rvm_tar_command="$rvm_tar_command:-tar"
else
case "$(uname)" in
(OpenBSD)
log "Trying to install GNU version of tar, might require sudo password"
if (( UID ))
then sudo pkg_add -z gtar-1
else pkg_add -z gtar-1
fi
rvm_tar_command=gtar
; ;
(Darwin|FreeBSD|DragonFly) # its not possible to autodetect on OSX, the help/man does not mention all flags
rvm_tar_command=tar
; ;
(SunOS)
case "$(uname -r)" in
(5.10)
log "Trying to install GNU version of tar, might require sudo password"
if (( UID ))
then
if \\which sudo > /dev/null 2> & 1
then sudo_10=sudo
elif \\which /opt/csw/bin/sudo > /dev/null 2> & 1
then sudo_10=/opt/csw/bin/sudo
else fail "sudo is required but not found. You may install sudo from OpenCSW repository (https://www.opencsw.org/about)"
fi
pkginfo -q CSWpkgutil || $sudo_10 pkgadd -a $rvm_path/config/solaris/noask -d https://get.opencsw.org/now CSWpkgutil
sudo /opt/csw/bin/pkgutil -iy CSWgtar -t https://mirror.opencsw.org/opencsw/unstable
else
pkginfo -q CSWpkgutil || pkgadd -a $rvm_path/config/solaris/noask -d https://get.opencsw.org/now CSWpkgutil
/opt/csw/bin/pkgutil -iy CSWgtar -t https://mirror.opencsw.org/opencsw/unstable
fi
rvm_tar_command=/opt/csw/bin/gtar
; ;
(*)
rvm_tar_command=tar
; ;
esac
esac
builtin command -v $rvm_tar_command:-gtar > /dev/null ||
fail "Could not find GNU compatible version of tar command, make sure its available first before continuing installation."
fi
if
[[ " $rvm_tar_options:- " != *" --no-same-owner "*]] & &
$rvm_tar_command --help 2> & 1 | GREP_OPTIONS="" \\grep -- --no-same-owner > /dev/null
then
rvm_tar_options="$rvm_tar_options:-$rvm_tar_options:+ --no-same-owner"
fi


usage()

printf "%b" "

Usage

rvm-installer [options] [action]

Options

[[--]version] < version>

The version or tag to install. Valid values are:

latest- The latest tagged version.
latest-minor- The latest minor version of the current major version.
latest-< x> - The latest minor version of version x.
latest-< x> .< y> - The latest patch version of version x.y.
< x> .< y> .< z> - Major version x, minor version y and patch z.

[--]branch < branch>

The name of the branch from which RVM is installed. This option can be used
with the following formats for < branch> :

< account> /

If account is rvm or mpapis, installs from one of the following:

https://github.com/rvm/rvm/archive/master.tar.gz
https://bitbucket.org/mpapis/rvm/get/master.tar.gz

Otherwise, installs from:

https://github.com/< account> /rvm/archive/master.tar.gz

< account> /< branch>

If account is rvm or mpapis, installs from one of the following:

https://github.com/rvm/rvm/archive/< branch> .tar.gz
https://bitbucket.org/mpapis/rvm/get/< branch> .tar.gz

Otherwise, installs from:

https://github.com/< account> /rvm/archive/< branch> .tar.gz

[/]< branch>

Installs the branch from one of the following:

https://github.com/rvm/rvm/archive/< branch> .tar.gz
https://bitbucket.org/mpapis/rvm/get/< branch> .tar.gz

[--]source < source>

Defines the repository from which RVM is retrieved and installed in the format:

< domain> /< account> /< repo>

Where:

< domain> - Is bitbucket.org, github.com or a github enterprise site serving
an RVM repository.
< account> - Is the user account in which the RVM repository resides.
< repo> - Is the name of the RVM repository.

Note that when using the [--]source option, one should only use the [/]branch format
with the [--]branch option. Failure to do so will result in undefined behavior.

--trace

Provides debug logging for the installation script.
Actions

master - Installs RVM from the master branch at rvm/rvm on github or mpapis/rvm
on bitbucket.org.
stable - Installs RVM from the stable branch a rvm/rvm on github or mpapis/rvm
on bitbucket.org.
help- Displays this output.

"


## duplication marker 32fosjfjsznkjneuera48jae
__rvm_curl_output_control()

if
(( $rvm_quiet_curl_flag:-0 == 1 ))
then
__flags+=( "--silent" "--show-error" )
elif
[[ " $*" == *" -s"* || " $*" == *" --silent"* ]]
then
# make sure --show-error is used with --silent
[[ " $*" == *" -S"* || " $*" == *" -sS"* || " $*" == *" --show-error"* ]] ||

__flags+=( "--show-error" )

fi


## duplication marker 32fosjfjsznkjneuera48jae
# -S is automatically added to -s
__rvm_curl()
(
__rvm_which curl > /dev/null ||

rvm_error "RVM requires curl. Install curl first and try again."
return 200


typeset

    推荐阅读