File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash -e
2
2
3
+ function linker_dashX {
4
+ local version=$( go version)
5
+ local regex=" go([0-9]+).([0-9]+)."
6
+ if [[ $version =~ $regex ]]; then
7
+ if [ ${BASH_REMATCH[1]} -eq " 1" -a ${BASH_REMATCH[2]} -le " 4" ]; then
8
+ echo " $1 \" $2 \" "
9
+ else
10
+ echo " $1 =$2 "
11
+ fi
12
+ else
13
+ echo " could not determine Go version"
14
+ exit 1
15
+ fi
16
+ }
17
+
3
18
ORG_PATH=" github.com/coreos"
4
19
REPO_PATH=" ${ORG_PATH} /flannel"
5
20
VERSION=$( git describe --dirty)
6
- GLDFLAGS=" -X github.com/coreos/flannel/version.Version \" ${VERSION} \" "
21
+ GLDFLAGS=" -X $( linker_dashX github.com/coreos/flannel/version.Version ${VERSION} ) "
7
22
8
23
if [ ! -h gopath/src/${REPO_PATH} ]; then
9
24
mkdir -p gopath/src/${ORG_PATH}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ replace_version ${VERSION}
25
25
git tag -a -m " ${VERSIONTAG} " " ${VERSIONTAG} "
26
26
27
27
# bump ver to placeholder and push to origin
28
- replace_version " ${VERSION} +was-not-built-properly "
28
+ replace_version " ${VERSION} +git "
29
29
git push " ${ORIGIN} " master
30
30
31
31
# push the tag
Original file line number Diff line number Diff line change 14
14
15
15
package version
16
16
17
- var Version = "0.5.3+was-not-built-properly "
17
+ var Version = "0.5.3+git "
You can’t perform that action at this time.
0 commit comments