cubefs/tool/preload/build.sh
leonrayang 3396accd80 feat(projectstructure): reorganize the module directory in the root to a suitable subdirectory
close:#22458839

Signed-off-by: leonrayang <chl696@sina.com>
2024-12-26 09:24:22 +08:00

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