Skip to content

Commit 49e4bc9

Browse files
committed
ci: add kas-shell-helper script
This helper will allow to define the same pattern to use kas shell. This way it will be used in the same way in all shell scripts used. The TOPDIR and KAS_WORK_DIR will be inferred in the helper and passed to the script to be executed. Signed-off-by: Jose Quaresma <[email protected]>
1 parent 5336aee commit 49e4bc9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ci/kas-shell-helper.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh -e
2+
# Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
3+
# SPDX-License-Identifier: MIT
4+
5+
TOPDIR=$(realpath $(dirname $(readlink -f $0))/..)
6+
SCRIPT=$(realpath $1)
7+
8+
if ! [ -f $SCRIPT ]; then
9+
echo "The script path argument is missing, please run it with:"
10+
echo " $0 /path/to/script"
11+
exit 1
12+
fi
13+
14+
# Ensure KAS workspace is outside of the checked out repo
15+
# Allows the caller to specify KAS_WORK_DIR, otherwise make temp one
16+
export KAS_WORK_DIR=$(realpath ${KAS_WORK_DIR:-$(mktemp -d)})
17+
18+
echo "Running kas in $KAS_WORK_DIR"
19+
exec kas shell $TOPDIR/ci/base.yml --command "$SCRIPT $TOPDIR $KAS_WORK_DIR"

0 commit comments

Comments
 (0)