diff --git a/update_immich.yml b/update_immich.yml index 0d26d60..7f5927e 100644 --- a/update_immich.yml +++ b/update_immich.yml @@ -74,27 +74,19 @@ - | cd {{ immich_dir }} - # Create override file if missing (keep local mounts here so upstream compose can be replaced safely) - python3 - <<'PY' - # Create docker-compose.override.yml only if missing - from pathlib import Path - import textwrap + # Ensure override compose exists (create if missing) + if [ ! -f "{{ immich_override_file }}" ]; then + printf '%s\n' \ + 'services:' \ + ' immich-server:' \ + ' volumes:' \ + ' - /mnt/nextcloud-howard-photos:/mnt/nextcloud-howard-photos' \ + ' - /mnt/nextcloud-kamilkaprdelka-photos:/mnt/nextcloud-kamilkaprdelka-photos' \ + > "{{ immich_override_file }}" + fi + # Fail early if override is still missing/empty + test -s "{{ immich_override_file }}" - p = Path("docker-compose.override.yml") - if p.exists(): - raise SystemExit(0) - - content = textwrap.dedent("""\ - # Local overrides for Immich (kept separate from upstream docker-compose.yml). - # If you want read-only mounts, append ':ro' to the right side. - services: - immich-server: - volumes: - - /mnt/nextcloud-howard-photos:/mnt/nextcloud-howard-photos - - /mnt/nextcloud-kamilkaprdelka-photos:/mnt/nextcloud-kamilkaprdelka-photos - """) - p.write_text(content, encoding="utf-8") - PY - | cd {{ immich_dir }}