From c2b1622da32e8201c9050cd0d1ab76e11c9df428 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Fri, 10 Jul 2026 23:54:40 +0200 Subject: [PATCH] Adds a build script --- build.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b18d9bc --- /dev/null +++ b/build.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# Script Configuration +URL="https://proxy.dandaedre.com/gitea/Ravenous/podman_ravenous" +CONTAINER_IMAGE="localhost/ravenous-podman:latest" + +print_error() { + echo "Error: $1" >&2 + echo "Please check the setup at:" >&2 + echo "$URL" >&2 +} + +# --- Prerequisites Check --- + +# 1. Check if Podman is installed and in PATH +if ! command -v podman &> /dev/null; then + print_error "Podman is not installed." + exit 1 +fi + +# 2. Check if the specific container image exists locally +# (Using 'image inspect' to verify exact match) +if ! podman image inspect "$CONTAINER_IMAGE" > /dev/null 2>&1; then + print_error "Container image '$CONTAINER_IMAGE' is not installed." + exit 1 +fi + +echo "--- Prerequisites met ---" + +# --- Build Logic Selection --- + +MODE="${1:-simple}" # Default to simple if no argument provided + +case "$MODE" in + --full | full) + echo ">>> Executing FULL build sequence..." + + # Podman Run: tablegen -e all (Note: No tty or rm flags here per your spec, + # though usually recommended. Keeping exact input commands.) + podman run --rm -v "$(pwd)":/workspace "$CONTAINER_IMAGE" tablegen -e all + + mkdir -p ~/.local/share/fonts/ + mkdir -p ./Images/Radar/ + + cp ./Ressources/lmroman8-regular.ttf ~/.local/share/fonts/ + + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" graphs load + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" graphs gen + + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -t glossaries -N Ravenous.tex + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex + + ;; + + *) # Defaults to Simple Build + echo ">>> Executing SIMPLE build..." + + podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex + + if [ $? -eq 0 ]; then + echo "--- Build Completed Successfully ---" + else + exit 1 # Propagate error code from the last command in simple mode + fi +esac + +exit 0