Skip to content

Commit dfa56f0

Browse files
committed
ci: add kas-container-shell helper script
This helper is very similar to the kas-shell-helper but it is intendend to use the kas-container. The TOPDIR and KAS_WORK_DIR cannot be changed within the container and are therefore constant. The SCRIPT path need to be relative to the TOPDIR also because of the mapping in the container. Finally the KAS_CONTAINER allows to use non-standard kas-container location in our ci. Signed-off-by: Jose Quaresma <[email protected]>
1 parent f45fcf2 commit dfa56f0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ci/kas-container-shell-helper.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
# make it relative to the TOPDIR
15+
SCRIPT=${SCRIPT#$TOPDIR/}
16+
17+
# on ci the kas-container is not on the default path
18+
KAS_CONTAINER=${KAS_CONTAINER:-$(which kas-container)}
19+
20+
exec $KAS_CONTAINER shell $TOPDIR/ci/base.yml --command "/repo/$SCRIPT /repo /work"

0 commit comments

Comments
 (0)