mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
Signed-off-by: bboyCH4 <hechi1014@126.com> Signed-off-by: lixiang12407 <960754123@qq.com>
16 lines
506 B
Bash
16 lines
506 B
Bash
#!/usr/bin/env bash
|
|
Version=`git describe --abbrev=0 --tags`
|
|
BranchName=`git rev-parse --abbrev-ref HEAD`
|
|
CommitID=`git rev-parse HEAD`
|
|
BuildTime=`date +%Y-%m-%d\ %H:%M`
|
|
|
|
[[ "-$GOPATH" == "-" ]] && { echo "GOPATH not set"; exit 1; }
|
|
|
|
go build -ldflags "\
|
|
-X github.com/cubefs/cubefs/proto.Version=${Version} \
|
|
-X github.com/cubefs/cubefs/proto.CommitID=${CommitID} \
|
|
-X github.com/cubefs/cubefs/proto.BranchName=${BranchName} \
|
|
-X 'github.com/cubefs/cubefs/proto.BuildTime=${BuildTime}'" \
|
|
-o cfs-preload
|
|
|