cicd: a series of small improvements

This commit is contained in:
Andrew Hlynskyi 2023-05-03 05:23:10 +03:00
parent 8caef571ef
commit ebd80906fb
5 changed files with 41 additions and 19 deletions

View file

@ -1,9 +1,16 @@
#!/bin/bash
set -x
# set -x
set -e
if [ "$CROSS" != 1 ]; then
if [ "$BUILD_CMD" != "cross" ]; then
echo "cross.sh - is a helper to assist only in cross compiling environments" >&2
echo "To use this tool set the BUILD_CMD env var to the \"cross\" value" >&2
exit 111
fi
if [ -z "$CROSS_IMAGE" ]; then
echo "The CROSS_IMAGE env var should be provided" >&2
exit 111
fi

View file

@ -1,9 +1,9 @@
#!/bin/bash
set -x
# set -x
set -e
if [ "$CROSS" = 1 ]; then
if [ "$BUILD_CMD" == "cross" ]; then
if [ -z "$CC" ]; then
echo "make.sh: CC is not set" >&2
exit 111

View file

@ -1,11 +1,27 @@
#!/bin/bash
set -x
# set -x
set -e
if [ -z "$ROOT" ]; then
echo "The ROOT env var should be set to absolute path of a repo root folder" >&2
exit 111
fi
if [ -z "$TARGET" ]; then
echo "The TARGET env var should be equal to a \`cargo build --target <TARGET>\` command value" >&2
exit 111
fi
tree_sitter="$ROOT"/target/"$TARGET"/release/tree-sitter
if [ "$CROSS" = 1 ]; then
if [ "$BUILD_CMD" == "cross" ]; then
if [ -z "$CROSS_RUNNER" ]; then
echo "The CROSS_RUNNER env var should be set to a CARGO_TARGET_*_RUNNER env var value" >&2
echo "that is available in a docker image used by the cross tool under the hood" >&2
exit 111
fi
cross.sh $CROSS_RUNNER "$tree_sitter" "$@"
else
"$tree_sitter" "$@"