Skip to content

Commit 833a285

Browse files
committed
Fix drone publish for arm
Signed-off-by: Brad Davidson <[email protected]>
1 parent 135460c commit 833a285

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

.drone.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ steps:
206206
dockerfile: package/Dockerfile
207207
environment:
208208
ARCH: "${DRONE_STAGE_ARCH}"
209-
DOCKER_BUILDKIT: "1"
209+
# Don't enable buildkit on arm, it will barf on the platform variant mismatch
210+
#DOCKER_BUILDKIT: "1"
210211
when:
211212
event:
212213
- tag

scripts/build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ source $(dirname $0)/version
66
cd $(dirname $0)/..
77

88
mkdir -p bin
9+
10+
if [ ${ARCH} = armv7l ] || [ ${ARCH} = arm ]; then
11+
export GOARCH="arm"
12+
export GOARM="7"
13+
fi
14+
915
if [ "$(uname)" = "Linux" ]; then
1016
OTHER_LINKFLAGS="-extldflags -static -s"
1117
fi

scripts/version

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ else
1313
VERSION="${COMMIT}${DIRTY}"
1414
fi
1515

16-
if [ -n "$ARCH" ]; then
17-
GOARCH=${ARCH}
18-
fi
19-
if [ -z "$GOARCH" ]; then
20-
GOARCH=$(go env GOHOSTARCH)
21-
fi
22-
if [ "$GOARCH" = "arm" ]; then
23-
GOARM=7
24-
fi
25-
26-
ARCH="${GOARCH}"
16+
GO=${GO-go}
17+
ARCH=${ARCH:-$("${GO}" env GOARCH)}
2718
SUFFIX="-${ARCH}"
2819

2920
TAG=${TAG:-${VERSION}${SUFFIX}}

0 commit comments

Comments
 (0)