Manage immich-sync with Argo CD

This commit is contained in:
2026-10-18 13:02:21 +02:00
commit cf768e1c93
9 changed files with 373 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
set -eu
if [ "$#" -ne 1 ] || ! printf '%s\n' "$1" | grep -Eq '^[0-9a-f]{40}$'; then
echo "usage: $0 <full-lowercase-git-sha>" >&2
exit 2
fi
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
repository_dir=$(dirname -- "${script_dir}")
kustomization="${repository_dir}/apps/immich-sync/kustomization.yaml"
temporary="${kustomization}.tmp"
awk -v tag="$1" '
/^ newTag: / {
if (updated) {
print "multiple newTag fields found" > "/dev/stderr"
exit 1
}
print " newTag: " tag
updated = 1
next
}
{ print }
END {
if (!updated) {
print "newTag field not found" > "/dev/stderr"
exit 1
}
}
' "${kustomization}" > "${temporary}"
mv "${temporary}" "${kustomization}"