Add photobooth uploader build service
This commit is contained in:
@@ -106,6 +106,24 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: "no"
|
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:
|
help-sync:
|
||||||
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
|
image: ${APP_IMAGE_REPO:-fotospiel-app}:${APP_IMAGE_TAG:-latest}
|
||||||
env_file:
|
env_file:
|
||||||
@@ -340,6 +358,7 @@ volumes:
|
|||||||
external: true
|
external: true
|
||||||
name: fotospiel-${APP_ENV:-prod}-storage
|
name: fotospiel-${APP_ENV:-prod}-storage
|
||||||
app-bootstrap-cache:
|
app-bootstrap-cache:
|
||||||
|
nuget-cache:
|
||||||
photobooth-import:
|
photobooth-import:
|
||||||
photobooth-ftp-auth:
|
photobooth-ftp-auth:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
|
|||||||
48
scripts/build-photobooth-uploader.sh
Normal file
48
scripts/build-photobooth-uploader.sh
Normal 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}"
|
||||||
Reference in New Issue
Block a user