DevOps之git日志信息解读

585 阅读1分钟

DevOps之git日志信息解读

1    版本信息

echo "解读commit数据进行镜像版本指定"$current_git_branch_latest_id=`git rev-parse HEAD`$current_git_branch_latest_short_id=`git rev-parse --short HEAD`$echo current git branch latest commit id=$current_git_branch_latest_id$echo current git branch latest commit short $id=$current_git_branch_latest_short_id# 提交的commit信息$echo $id

2    提交作者

$author=`git log --pretty=format:“%an” $current_git_branch_latest_id -1`$echo $author

3    提交时间

$date=`git log --pretty=format:“%cd” $current_git_branch_latest_id -1`$echo $date

4    提交message

$message=`git log --pretty=format:“%s” $current_git_branch_latest_id -1`$echo $message

5    完整信息

$current_git_branch_latest_id=`git rev-parse HEAD`$current_git_branch_latest_short_id=`git rev-parse --short HEAD`$echo current git branch latest commit id=$current_git_branch_latest_id$echo current git branch latest commit short $id=$current_git_branch_latest_short_id

总结

    版本解析的问题,对于CI/CD系统建设具有十分重要的作用,研制Devops开发流程,实现代码的中间操作,完成对于代码的定制,具有十分重要的作用。

本文由博客作者流雨声 github地址:github.com/vpc123