Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion support/ci/pipelines/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
TARGET=""
EXECUTOR_VERSION=""
EXTRA_BUNDLE=""
COMPRESSION_LEVEL=9

while [[ $# -gt 0 ]]; do
case $1 in
Expand Down Expand Up @@ -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)"
Expand All @@ -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"
Expand Down Expand Up @@ -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