File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change 7
7
exit 1
8
8
fi
9
9
10
- export GOOS=${1}
11
- export GOARCH=${2}
10
+ export GOOS=" $1 "
11
+ export GOARCH=" $2 "
12
12
13
- BUILD_VERSION= ${3}
13
+ BUILD_NUMBER= " $3 "
14
14
NAME=" buildkite-agent"
15
15
16
- if [[ " $GOOS " = " dragonflybsd" ]]; then
16
+ if [[ " ${ GOOS} " = " dragonflybsd" ]]; then
17
17
export GOOS=" dragonfly"
18
18
fi
19
19
20
20
BUILD_PATH=" pkg"
21
- BINARY_FILENAME=" $NAME - $ GOOS- $ GOARCH"
21
+ BINARY_FILENAME=" ${ NAME} - ${ GOOS} - ${ GOARCH} "
22
22
23
- if [[ " $GOARCH " = " armhf" ]]; then
23
+ if [[ " ${ GOARCH} " = " armhf" ]]; then
24
24
export GOARCH=" arm"
25
25
export GOARM=" 7"
26
26
fi
27
27
28
- echo -e " Building $NAME with:\n"
28
+ echo -e " Building ${ NAME} with:\n"
29
29
30
- echo " GOOS=$GOOS "
31
- echo " GOARCH=$GOARCH "
32
- if [[ -n " $GOARM " ]]; then
33
- echo " GOARM=$GOARM "
30
+ echo " GOOS=${ GOOS} "
31
+ echo " GOARCH=${ GOARCH} "
32
+ if [[ -n " ${ GOARM} " ]]; then
33
+ echo " GOARM=${ GOARM} "
34
34
fi
35
- echo " BUILD_VERSION= $BUILD_VERSION "
35
+ echo " BUILD_NUMBER= ${BUILD_NUMBER} "
36
36
echo " "
37
37
38
38
# Add .exe for Windows builds
39
39
if [[ " $GOOS " == " windows" ]]; then
40
- BINARY_FILENAME=" $BINARY_FILENAME .exe"
40
+ BINARY_FILENAME=" ${ BINARY_FILENAME} .exe"
41
41
fi
42
42
43
43
# Disable CGO completely
@@ -47,8 +47,8 @@ export CGO_ENABLED=0
47
47
" $( dirname $0 ) " /generate-acknowledgements.sh
48
48
49
49
mkdir -p $BUILD_PATH
50
- go build -v -ldflags " -X github.com/buildkite/agent/v3/version.buildVersion= $BUILD_VERSION " -o $ BUILD_PATH/ $ BINARY_FILENAME .
50
+ go build -v -ldflags " -X github.com/buildkite/agent/v3/version.buildNumber= ${BUILD_NUMBER} " -o " ${ BUILD_PATH} / ${ BINARY_FILENAME} " .
51
51
52
- chmod +x $ BUILD_PATH/ $ BINARY_FILENAME
52
+ chmod +x " ${ BUILD_PATH} / ${ BINARY_FILENAME} "
53
53
54
- echo -e " \nDone: \033[33m$BUILD_PATH / $ BINARY_FILENAME \033[0m 💪"
54
+ echo -e " \nDone: \033[33m${ BUILD_PATH} / ${ BINARY_FILENAME} \033[0m 💪"
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ import (
14
14
var (
15
15
//go:embed VERSION
16
16
baseVersion string
17
+
18
+ // buildNumber is filled in by scripts/build-binary.sh by passing -ldflags
19
+ // "-X github.com/buildkite/agent/v3/version.buildNumber=${BUILDKITE_BUILD_NUMBER}"
17
20
buildNumber = "x"
18
21
)
19
22
You can’t perform that action at this time.
0 commit comments