mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
add binary size check script, makefile target, and added to CI (#2209)
* add binary size check script, makefile target, and added to drone Signed-off-by: Brian Downs <brian.downs@gmail.com> * move script call to package script Signed-off-by: Brian Downs <brian.downs@gmail.com> * move script call to ci script Signed-off-by: Brian Downs <brian.downs@gmail.com>
This commit is contained in:
parent
4954923097
commit
f72d39ad9c
4
Makefile
4
Makefile
@ -29,3 +29,7 @@ generate: build/data
|
|||||||
|
|
||||||
build/data:
|
build/data:
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
|
.PHONY: binary-size-check
|
||||||
|
binary-size-check:
|
||||||
|
scripts/binary_size_check.sh
|
||||||
|
17
scripts/binary_size_check.sh
Executable file
17
scripts/binary_size_check.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "${DEBUG}" = 1 ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAX_BINARY_SIZE=61000000
|
||||||
|
SIZE=$(ls -l dist/artifacts/k3s | awk -F ' ' '{print $5}')
|
||||||
|
|
||||||
|
if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then
|
||||||
|
echo "k3s binary exceeds acceptable size of "${MAX_BINARY_SIZE}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
@ -7,5 +7,7 @@ cd $(dirname $0)
|
|||||||
if [ -z "$SKIP_VALIDATE" ]; then
|
if [ -z "$SKIP_VALIDATE" ]; then
|
||||||
./validate
|
./validate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./build
|
./build
|
||||||
./package
|
./package
|
||||||
|
./binary_size_check.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user