Files
HLRTest/container/run.sh
T
Ivan Avdeev c6edc9f3fe embed steam Half-Life data into the image itself
allows also adding hlsdk libs to the image
makes it easier to build, manage, and run
2026-04-08 01:17:49 -04:00

56 lines
1012 B
Bash
Executable File

#!/bin/bash
set -eux
NAME=xash-builder
HLRTEST_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
source .env
build-image-hlsdk() {
podman build -t ubuntu-hlsdk -f Containerfile.hlsdk
}
build-image() {
podman build -t ubuntu-xash-builder -f Containerfile
}
build() {
build-image-hlsdk
build-image
}
render-test() {
OUTPUT="${HLRTEST_PATH}/render/work"
# Make sure the image ubuntu user can write to the output
chmod -R o+rw "${OUTPUT}"
podman run -it --rm \
--name ${NAME} \
--userns=keep-id:uid=1000,gid=1000 \
\
--cap-drop=ALL \
--security-opt=no-new-privileges \
--read-only \
--tmpfs /tmp \
\
-v /dev/dri/renderD128:/dev/dri/renderD128:ro \
\
-v /opt/hl \
-v ${HALFLIFE_PBR_REPO_DIR}/valve/pbr:/opt/hl/valve/pbr:ro \
\
-v ${XASH3D_RT_REPO_DIR}:/build/xash3d-fwgs:O \
\
-v ${HLRTEST_PATH}:/build/HLRTest:ro \
-v ${OUTPUT}:/build/HLRTest/render/work \
\
ubuntu-xash-builder:latest \
"$@"
}
shell() {
podman exec -it ${NAME} /bin/bash
}
time "$@"