Skip to content

Commit

Permalink
Merge pull request etcd-io#3958 from gyuho/build_gotip
Browse files Browse the repository at this point in the history
build: parse go version at go tip
  • Loading branch information
xiang90 committed Dec 4, 2015
2 parents 127b529 + 0473cb9 commit b806e51
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ eval $(go env)
GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"`

val=$(go version)
ver=$(echo $val | awk -F ' ' '{print $3}' | awk -F '.' '{print $2}')
if [ $ver -gt 4 ]; then
# if 'go version' contains string 'devel', it assumes the go tip branch,
# which is greater than go 1.5+.
if [[ $val == *"devel"* ]]
then
LINK_OPERATOR="="
else
LINK_OPERATOR=" "
ver=$(echo $val | awk -F ' ' '{print $3}' | awk -F '.' '{print $2}')
if [ $ver -gt 4 ]; then
LINK_OPERATOR="="
else
LINK_OPERATOR=" "
fi
fi

# Static compilation is useful when etcd is run in a container
Expand Down

0 comments on commit b806e51

Please sign in to comment.