Add photobooth uploader build service
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-13 08:37:26 +01:00
parent 9f4a202d2b
commit 1ca7545f86
2 changed files with 67 additions and 0 deletions

View File

@@ -106,6 +106,24 @@ services:
condition: service_healthy
restart: "no"
photobooth-uploader-build:
image: mcr.microsoft.com/dotnet/sdk:10.0
working_dir: /var/www/html
command:
- bash
- -lc
- /var/www/html/scripts/build-photobooth-uploader.sh
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
NUGET_PACKAGES: /root/.nuget/packages
volumes:
- app-code:/var/www/html
- nuget-cache:/root/.nuget/packages
depends_on:
app:
condition: service_healthy
restart: "no"
help-sync:
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
env_file:
@@ -340,6 +358,7 @@ volumes:
external: true
name: fotospiel-${APP_ENV:-prod}-storage
app-bootstrap-cache:
nuget-cache:
photobooth-import:
photobooth-ftp-auth:
mysql-data:

View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail
WORKDIR=${WORKDIR:-/var/www/html}
SRC_DIR="${WORKDIR}/clients/photobooth-uploader/PhotoboothUploader"
OUT_DIR="${WORKDIR}/public/downloads"
OUT_FILE="${OUT_DIR}/PhotoboothUploader.exe"
STAMP_FILE="${OUT_DIR}/photobooth-uploader.hash"
if [[ ! -d "$SRC_DIR" ]]; then
echo "[photobooth-uploader] Source directory not found: ${SRC_DIR}"
exit 0
fi
mkdir -p "$OUT_DIR"
compute_hash() {
find "$SRC_DIR" -type f \
-not -path "*/bin/*" \
-not -path "*/obj/*" \
-print \
| LC_ALL=C sort \
| xargs sha256sum \
| sha256sum \
| awk '{print $1}'
}
HASH=$(compute_hash)
if [[ -f "$OUT_FILE" && -f "$STAMP_FILE" ]]; then
CURRENT_HASH=$(cat "$STAMP_FILE" || true)
if [[ "$CURRENT_HASH" == "$HASH" ]]; then
echo "[photobooth-uploader] Up to date, skipping publish."
exit 0
fi
fi
echo "[photobooth-uploader] Publishing uploader exe..."
dotnet publish "${SRC_DIR}/PhotoboothUploader.csproj" \
-c Release \
-r win-x64 \
--self-contained true \
/p:PublishSingleFile=true \
/p:IncludeNativeLibrariesForSelfExtract=true \
-o "$OUT_DIR"
echo "$HASH" > "$STAMP_FILE"
echo "[photobooth-uploader] Published to ${OUT_FILE}"