diff --git a/support/ci/pipelines/build.sh b/support/ci/pipelines/build.sh index a06285c3..bc36b41b 100755 --- a/support/ci/pipelines/build.sh +++ b/support/ci/pipelines/build.sh @@ -3,6 +3,7 @@ TARGET="" EXECUTOR_VERSION="" EXTRA_BUNDLE="" +COMPRESSION_LEVEL=9 while [[ $# -gt 0 ]]; do case $1 in @@ -32,6 +33,14 @@ while [[ $# -gt 0 ]]; do EXTRA_BUNDLE="$(readlink -f "$EXTRA_BUNDLE")" shift ;; + --compression-level) + COMPRESSION_LEVEL="$2" + shift 2 + ;; + --compression-level=*) + COMPRESSION_LEVEL="${1#*=}" + shift + ;; -h|--help) echo "Usage: $0 [--target TARGET] [--executor-version VERSION]" echo " --target TARGET Specify the target platform (default: universal)" @@ -56,6 +65,13 @@ if [[ -n "$EXECUTOR_VERSION" && -z "$EXECUTOR_VERSION" ]]; then exit 1 fi +if [[ "$COMPRESSION_LEVEL" == [0-9] ]]; then + true +else + echo "Error: --compression-level must be an integer between 0 and 9" >&2 + exit 1 +fi + HEAD_REVISION=$(git rev-parse HEAD) echo "\$TARGET = $TARGET" @@ -87,6 +103,6 @@ then tar -A -f "$PREV/build/genvm-$TARGET.tar" "$EXTRA_BUNDLE" fi -xz -z -9 --force "$PREV/build/genvm-$TARGET.tar" +xz -z "-$COMPRESSION_LEVEL" --force "$PREV/build/genvm-$TARGET.tar" popd