Skip to content

Commit

Permalink
Fix drone publish for arm
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Oct 25, 2022
1 parent 135460c commit 833a285
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ steps:
dockerfile: package/Dockerfile
environment:
ARCH: "${DRONE_STAGE_ARCH}"
DOCKER_BUILDKIT: "1"
# Don't enable buildkit on arm, it will barf on the platform variant mismatch
#DOCKER_BUILDKIT: "1"
when:
event:
- tag
Expand Down
6 changes: 6 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ source $(dirname $0)/version
cd $(dirname $0)/..

mkdir -p bin

if [ ${ARCH} = armv7l ] || [ ${ARCH} = arm ]; then
export GOARCH="arm"
export GOARM="7"
fi

if [ "$(uname)" = "Linux" ]; then
OTHER_LINKFLAGS="-extldflags -static -s"
fi
Expand Down
13 changes: 2 additions & 11 deletions scripts/version
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ else
VERSION="${COMMIT}${DIRTY}"
fi

if [ -n "$ARCH" ]; then
GOARCH=${ARCH}
fi
if [ -z "$GOARCH" ]; then
GOARCH=$(go env GOHOSTARCH)
fi
if [ "$GOARCH" = "arm" ]; then
GOARM=7
fi

ARCH="${GOARCH}"
GO=${GO-go}
ARCH=${ARCH:-$("${GO}" env GOARCH)}
SUFFIX="-${ARCH}"

TAG=${TAG:-${VERSION}${SUFFIX}}
Expand Down

0 comments on commit 833a285

Please sign in to comment.