Skip to content

Commit 886d261

Browse files
ramonskierkoster
authored andcommitted
add arm builds
1 parent 0824757 commit 886d261

File tree

2 files changed

+39
-23
lines changed
  • ci/tasks

2 files changed

+39
-23
lines changed

ci/tasks/build-release/task

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
ROOT="${PWD}"
44
BUILDS_PATH="${ROOT}/builds"
55
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"
77
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"
99
BUILD_PATH=""
1010

1111
function main() {
@@ -27,13 +27,19 @@ function main() {
2727
rm -rf ./bosh/deployments/jumpbox-deployment/.git
2828

2929
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
3743
done
3844
popd > /dev/null
3945

@@ -49,12 +55,16 @@ function main() {
4955

5056
echo "- Includes terraform binaries from ${TF_URL}" >> body
5157

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+
5466
windows_sha=$(shasum -a 256 "${BBL_WINDOWS_BUILD_PATH}" | cut -d ' ' -f 1)
5567

56-
echo "- *Linux sha256: \`${linux_sha}\`*" >> body
57-
echo "- *OSX sha256: \`${osx_sha}\`*" >> body
5868
echo "- *Windows sha256: \`${windows_sha}\`*" >> body
5969
echo "*Known Issues:* Windows support is incomplete." >> body
6070
popd > /dev/null
@@ -66,8 +76,8 @@ function build_bbl() {
6676
local build_path
6777
build_path="$1"
6878

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" \
7181
go build \
7282
-ldflags "-X main.Version=${BBL_VERSION}" \
7383
-o "${build_path}" .
@@ -77,13 +87,14 @@ function determine_build_path() {
7787
local platform
7888
local build_path
7989
platform=$1
90+
arch=$2
8091
build_path="${BUILDS_PATH}/bin/bbl-v${BBL_VERSION}_"
8192
if [[ $platform == "darwin" ]]; then
82-
build_path+="osx"
93+
build_path+="osx_${arch}"
8394
elif [[ $platform == "linux" ]]; then
84-
build_path+="linux_x86-64"
95+
build_path+="linux_${arch}"
8596
elif [[ $platform == "windows" ]]; then
86-
build_path+="windows.exe"
97+
build_path+="windows_${arch}.exe"
8798
fi
8899

89100
BUILD_PATH="${build_path}"

ci/tasks/download-terraform/task

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ function download_terraform() {
77
local zip_name
88

99
platform=${1}
10-
zip_name="terraform_${TF_VERSION}_${platform}_amd64.zip"
10+
arch=${2}
11+
zip_name="terraform_${TF_VERSION}_${platform}_${arch}.zip"
1112

1213
ZIP_URL="${URL_BASE}/${TF_VERSION}/${zip_name}"
1314
wget ${ZIP_URL} -q
@@ -18,11 +19,15 @@ function download_terraform() {
1819

1920
pushd ${ROOT}/terraform-binaries > /dev/null
2021
for platform in "darwin" "linux"; do
21-
download_terraform ${platform}
22-
mv terraform "terraform_${platform}"
22+
for arch in "amd64" "arm64"; do
23+
download_terraform ${platform} ${arch}
24+
mv terraform "terraform_${platform}_${arch}"
25+
done
2326
done
2427
for platform in "windows"; do
25-
download_terraform ${platform}
26-
mv terraform.exe "terraform_${platform}.exe"
28+
for arch in "amd64"; do
29+
download_terraform ${platform} ${arch}
30+
mv terraform.exe "terraform_${platform}_${arch}.exe"
31+
done
2732
done
2833
popd > /dev/null

0 commit comments

Comments
 (0)