mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
10474638d7
* Remove unused release.sh and DAPPER_HOST_ARCH * Reliably use ARCH from version.sh * Export GOARCH and GOARM so that they are used by `go build` Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
29 lines
589 B
Bash
Executable File
29 lines
589 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if [ "${DEBUG}" = 1 ]; then
|
|
set -x
|
|
fi
|
|
|
|
. ./scripts/version.sh
|
|
|
|
MAX_BINARY_SIZE=61000000
|
|
BIN_SUFFIX="-${ARCH}"
|
|
if [ ${ARCH} = amd64 ]; then
|
|
BIN_SUFFIX=""
|
|
elif [ ${ARCH} = arm ]; then
|
|
BIN_SUFFIX="-armhf"
|
|
fi
|
|
|
|
CMD_NAME="dist/artifacts/k3s${BIN_SUFFIX}"
|
|
SIZE=$(stat -c '%s' ${CMD_NAME})
|
|
|
|
if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then
|
|
echo "k3s binary ${CMD_NAME} size ${SIZE} exceeds max acceptable size of ${MAX_BINARY_SIZE} bytes"
|
|
exit 1
|
|
fi
|
|
|
|
echo "k3s binary ${CMD_NAME} size ${SIZE} is less than max acceptable size of ${MAX_BINARY_SIZE} bytes"
|
|
exit 0
|