diff --git a/build_truenas.sh b/build_truenas.sh new file mode 100755 index 0000000..04c2b3e --- /dev/null +++ b/build_truenas.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Build Jellyfin Docker image on TrueNAS +# Usage: ./build_truenas.sh [tag] +# Example: ./build_truenas.sh 192.168.79.249 10.11.5-custom + +set -e + +TRUENAS_HOST="${1}" +IMAGE_TAG="${2:-latest}" +BUILD_DIR="/tmp/jellyfin-build-$$" + +if [ -z "$TRUENAS_HOST" ]; then + echo "Usage: $0 [tag]" + echo "Example: $0 192.168.79.249 10.11.5-custom" + exit 1 +fi + +echo "==================================================" +echo "Building Jellyfin on TrueNAS" +echo "==================================================" +echo "Host: $TRUENAS_HOST" +echo "Tag: $IMAGE_TAG" +echo "==================================================" + +# Create temp build directory on TrueNAS +echo "Creating build directory on TrueNAS..." +ssh root@${TRUENAS_HOST} "mkdir -p ${BUILD_DIR}" + +# Sync repository to TrueNAS (excluding submodules, will init on TrueNAS) +echo "Syncing repository to TrueNAS..." +rsync -avz --progress \ + --exclude='node_modules' \ + --exclude='bin' \ + --exclude='obj' \ + --exclude='jellyfin-web' \ + --exclude='jellyfin-server' \ + ./ root@${TRUENAS_HOST}:${BUILD_DIR}/ + +# Update submodule URLs to use IP address and initialize on TrueNAS +echo "Initializing submodules on TrueNAS..." +ssh root@${TRUENAS_HOST} "cd ${BUILD_DIR} && \ + git config --global --add safe.directory ${BUILD_DIR} && \ + git config submodule.jellyfin-server.url ssh://git@192.168.79.249:222/admin/jellyfin.git && \ + git config submodule.jellyfin-web.url ssh://git@192.168.79.249:222/admin/jellyfin-web.git && \ + git submodule update --init --recursive" + +# Build Docker image on TrueNAS +echo "Building Docker image on TrueNAS..." +ssh root@${TRUENAS_HOST} "cd ${BUILD_DIR} && docker build \ + --build-arg DOTNET_VERSION=9.0 \ + --build-arg PACKAGE_ARCH=amd64 \ + --build-arg DOTNET_ARCH=x64 \ + --build-arg IMAGE_ARCH=amd64 \ + --build-arg TARGET_ARCH=amd64 \ + --build-arg JELLYFIN_VERSION=${IMAGE_TAG} \ + -t jellyfin:${IMAGE_TAG} \ + --file docker/Dockerfile ." + +# Tag image +echo "Tagging image..." +ssh root@${TRUENAS_HOST} "docker tag jellyfin:${IMAGE_TAG} jellyfin:latest" + +# Cleanup +echo "Cleaning up build directory..." +ssh root@${TRUENAS_HOST} "rm -rf ${BUILD_DIR}" + +echo "==================================================" +echo "✓ Build complete!" +echo "==================================================" +echo "Image: jellyfin:${IMAGE_TAG}" +echo "" +echo "To run the container:" +echo " ssh root@${TRUENAS_HOST}" +echo " docker run -d jellyfin:${IMAGE_TAG}" +echo "==================================================" diff --git a/jellyfin-web b/jellyfin-web index 2fab9f4..ef7275f 160000 --- a/jellyfin-web +++ b/jellyfin-web @@ -1 +1 @@ -Subproject commit 2fab9f497eb2b5b2c2ea3113967d7f68611f83b6 +Subproject commit ef7275fd65e149a471d0be5bd7685cdf8aae3290