3
3
ROOT=" ${PWD} "
4
4
BUILDS_PATH=" ${ROOT} /builds"
5
5
BBL_VERSION=" $( cat ${ROOT} /version/number) "
6
- BBL_LINUX_BUILD_PATH=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _linux_x86-64 "
6
+ BBL_LINUX_BUILD_PATH=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _linux "
7
7
BBL_OSX_BUILD_PATH=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _osx"
8
- BBL_WINDOWS_BUILD_PATH=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _windows .exe"
8
+ BBL_WINDOWS_BUILD_PATH=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _windows_amd64 .exe"
9
9
BUILD_PATH=" "
10
10
11
11
function main() {
@@ -27,13 +27,19 @@ function main() {
27
27
rm -rf ./bosh/deployments/jumpbox-deployment/.git
28
28
29
29
for platform in " darwin" " windows" " linux" ; do
30
- # copy binaries
31
- mv ${ROOT} /terraform-binaries/terraform_${platform} * ./terraform/binary_dist/terraform
32
- create_mod
33
- pushd " bbl/" > /dev/null
34
- determine_build_path ${platform}
35
- build_bbl ${BUILD_PATH} ${platform}
36
- popd > /dev/null
30
+ for arch in " amd64" " arm64" ; do
31
+ if [[ ${platform} == " windows" && ${arch} == " arm64" ]]; then
32
+ continue
33
+ fi
34
+
35
+ # copy binaries
36
+ mv ${ROOT} /terraform-binaries/terraform_${platform} _${arch} * ./terraform/binary_dist/terraform
37
+ create_mod
38
+ pushd " bbl/" > /dev/null
39
+ determine_build_path ${platform} ${arch}
40
+ build_bbl ${BUILD_PATH} ${platform} ${arch}
41
+ popd > /dev/null
42
+ done
37
43
done
38
44
popd > /dev/null
39
45
@@ -49,12 +55,16 @@ function main() {
49
55
50
56
echo " - Includes terraform binaries from ${TF_URL} " >> body
51
57
52
- linux_sha=$( shasum -a 256 " ${BBL_LINUX_BUILD_PATH} " | cut -d ' ' -f 1)
53
- osx_sha=$( shasum -a 256 " ${BBL_OSX_BUILD_PATH} " | cut -d ' ' -f 1)
58
+ for arch in " amd64" " arm64" ; do
59
+ linux_sha=$( shasum -a 256 " ${BBL_LINUX_BUILD_PATH} _${arch} " | cut -d ' ' -f 1)
60
+ osx_sha=$( shasum -a 256 " ${BBL_OSX_BUILD_PATH} _${arch} " | cut -d ' ' -f 1)
61
+
62
+ echo " - *Linux_${arch} sha256: \` ${linux_sha} \` *" >> body
63
+ echo " - *OSX_${arch} sha256: \` ${osx_sha} \` *" >> body
64
+ done
65
+
54
66
windows_sha=$( shasum -a 256 " ${BBL_WINDOWS_BUILD_PATH} " | cut -d ' ' -f 1)
55
67
56
- echo " - *Linux sha256: \` ${linux_sha} \` *" >> body
57
- echo " - *OSX sha256: \` ${osx_sha} \` *" >> body
58
68
echo " - *Windows sha256: \` ${windows_sha} \` *" >> body
59
69
echo " *Known Issues:* Windows support is incomplete." >> body
60
70
popd > /dev/null
@@ -66,8 +76,8 @@ function build_bbl() {
66
76
local build_path
67
77
build_path=" $1 "
68
78
69
- echo " Building amd64 for $2 "
70
- CGO_ENABLED=0 GOARCH=" amd64 " GOOS=" $2 " \
79
+ echo " Building $3 for $2 "
80
+ CGO_ENABLED=0 GOARCH=" $3 " GOOS=" $2 " \
71
81
go build \
72
82
-ldflags " -X main.Version=${BBL_VERSION} " \
73
83
-o " ${build_path} " .
@@ -77,13 +87,14 @@ function determine_build_path() {
77
87
local platform
78
88
local build_path
79
89
platform=$1
90
+ arch=$2
80
91
build_path=" ${BUILDS_PATH} /bin/bbl-v${BBL_VERSION} _"
81
92
if [[ $platform == " darwin" ]]; then
82
- build_path+=" osx "
93
+ build_path+=" osx_ ${arch} "
83
94
elif [[ $platform == " linux" ]]; then
84
- build_path+=" linux_x86-64 "
95
+ build_path+=" linux_ ${arch} "
85
96
elif [[ $platform == " windows" ]]; then
86
- build_path+=" windows .exe"
97
+ build_path+=" windows_ ${arch} .exe"
87
98
fi
88
99
89
100
BUILD_PATH=" ${build_path} "
0 commit comments