forked from lixiang12407/chubaofs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cubefs#1003 from chubaofs/syncFrom_release-20200720
Sync from release-20200720
- Loading branch information
Showing
87 changed files
with
4,769 additions
and
1,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
#!/usr/bin/env bash | ||
RootPath=$(cd $(dirname $0)/..; pwd) | ||
|
||
Version=`git describe --abbrev=0 --tags 2>/dev/null` | ||
BranchName=`git rev-parse --abbrev-ref HEAD 2>/dev/null` | ||
CommitID=`git rev-parse HEAD 2>/dev/null` | ||
BranchName=`git rev-parse --abbrev-ref HEAD` | ||
CommitID=`git rev-parse HEAD` | ||
BuildTime=`date +%Y-%m-%d\ %H:%M` | ||
|
||
SrcPath=${RootPath}/cli | ||
TargetFile=${1:-$RootPath/cli/cfs-cli} | ||
|
||
[[ "-$GOPATH" == "-" ]] && { echo "GOPATH not set"; exit 1; } | ||
|
||
LDFlags="-X github.com/chubaofs/chubaofs/proto.Version=${Version} \ | ||
-X github.com/chubaofs/chubaofs/proto.CommitID=${CommitID} \ | ||
-X github.com/chubaofs/chubaofs/proto.BranchName=${BranchName} \ | ||
-X 'github.com/chubaofs/chubaofs/proto.BuildTime=${BuildTime}' " | ||
|
||
go build \ | ||
-ldflags "${LDFlags}" \ | ||
-o $TargetFile \ | ||
${SrcPath}/*.go | ||
go build -ldflags "-X main.CommitID=${CommitID} -X main.BranchName=${BranchName} -X 'main.BuildTime=${BuildTime}'" -o cfs-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.