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
This commit is contained in:
+20
-11
@@ -7,33 +7,42 @@ HLRTEST_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
||||
|
||||
source .env
|
||||
|
||||
build-image() {
|
||||
podman build -t ubuntu-xash-builder .
|
||||
build-image-hlsdk() {
|
||||
podman build -t ubuntu-hlsdk -f Containerfile.hlsdk
|
||||
}
|
||||
|
||||
run() {
|
||||
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 \
|
||||
--user $(id -u):$(id -g) \
|
||||
--userns=keep-id:uid=1000,gid=1000 \
|
||||
\
|
||||
--cap-drop=ALL \
|
||||
--security-opt=no-new-privileges \
|
||||
--read-only \
|
||||
--tmpfs /tmp \
|
||||
--tmpfs /build/obj \
|
||||
--tmpfs /build/out \
|
||||
\
|
||||
-v /dev/dri/renderD128:/dev/dri/renderD128:ro \
|
||||
\
|
||||
-v ${STEAM_HALFLIFE_DIR}/valve:/build/out/valve:O \
|
||||
-v ${STEAM_HALFLIFE_DIR}/valve_hd:/build/out/valve_hd:ro \
|
||||
-v ${HALFLIFE_PBR_REPO_DIR}/valve/pbr:/build/out/valve/pbr: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 ${HLRTEST_PATH}/render/work:/build/HLRTest/render/work \
|
||||
-v ${OUTPUT}:/build/HLRTest/render/work \
|
||||
\
|
||||
ubuntu-xash-builder:latest \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user