From 21ce9478f4ffa6283e77f7e4e147af6b94d00749 Mon Sep 17 00:00:00 2001 From: "martin.fencl" Date: Wed, 10 Dec 2025 12:20:47 +0100 Subject: [PATCH] edit --- update_immich.yml | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/update_immich.yml b/update_immich.yml index 7aadc5b..5339a25 100644 --- a/update_immich.yml +++ b/update_immich.yml @@ -41,35 +41,11 @@ docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker" # Commands to run on the target VM (quiet outputs) - # 1) Check directory exists (we do NOT create anything, to stay safe) - # 2) Safely download latest docker-compose.yml from GitHub (with backup) - # 3) Pull images according to compose - # 4) Start / update stack + # 1) Download latest docker-compose.yml from GitHub (with backup) + # 2) Pull images according to compose + # 3) Start / update stack immich_commands: - - >- - [ -d "{{ immich_compose_dir }}" ] || { - echo "ERROR: Directory {{ immich_compose_dir }} does not exist on VM; not touching anything." >&2; - exit 1; - } - - >- - cd "{{ immich_compose_dir }}" && - wget -qO docker-compose.yml.new "{{ immich_compose_url }}" || { - echo "ERROR: Failed to download docker-compose.yml from GitHub; keeping existing one." >&2; - rm -f docker-compose.yml.new 2>/dev/null || true; - exit 1; - }; - if [ -s docker-compose.yml.new ]; then - echo "Downloaded new docker-compose.yml from GitHub (Immich latest)."; - if [ -f docker-compose.yml ]; then - cp docker-compose.yml "docker-compose.yml.bak-$(date +%F_%H-%M-%S)"; - echo "Existing docker-compose.yml backed up."; - fi; - mv docker-compose.yml.new docker-compose.yml; - else - echo "WARNING: Downloaded docker-compose.yml.new is empty; keeping existing one." >&2; - rm -f docker-compose.yml.new 2>/dev/null || true; - exit 1; - fi + - "cd {{ immich_compose_dir }} && wget -qO docker-compose.yml.new {{ immich_compose_url }} || true; if [ -s docker-compose.yml.new ]; then echo 'Downloaded new docker-compose.yml from GitHub (Immich latest).'; if [ -f docker-compose.yml ]; then cp docker-compose.yml docker-compose.yml.bak-$(date +%F_%H-%M-%S); echo 'Existing docker-compose.yml backed up.'; fi; mv docker-compose.yml.new docker-compose.yml; else echo 'WARNING: Failed to download a valid docker-compose.yml, keeping existing one.' >&2; rm -f docker-compose.yml.new 2>/dev/null || true; fi" - "{{ docker_prefix }} compose -p {{ immich_project }} -f {{ immich_compose_file }} pull >/dev/null" - "{{ docker_prefix }} compose -p {{ immich_project }} -f {{ immich_compose_file }} up -d --remove-orphans >/dev/null"