Immich: unpin release; use fetch & deploy function for update (#5355)
This commit is contained in:
parent
c684472cb4
commit
a2b8a87cc4
20
ct/immich.sh
20
ct/immich.sh
@ -181,7 +181,10 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ -f ~/.immich && "$RELEASE" == "$(cat ~/.immich)" ]]; then
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
msg_info "Stopping ${APP} services"
|
msg_info "Stopping ${APP} services"
|
||||||
systemctl stop immich-web
|
systemctl stop immich-web
|
||||||
systemctl stop immich-ml
|
systemctl stop immich-ml
|
||||||
@ -218,13 +221,12 @@ function update_script() {
|
|||||||
|
|
||||||
cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR"
|
cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR"
|
||||||
rm -rf "${APP_DIR:?}"/*
|
rm -rf "${APP_DIR:?}"/*
|
||||||
rm -rf "$SRC_DIR"
|
|
||||||
immich_zip=$(mktemp)
|
|
||||||
curl -fsSL "https://github.com/immich-app/immich/archive/refs/tags/v${RELEASE}.zip" -o "$immich_zip"
|
|
||||||
msg_info "Updating ${APP} web and microservices"
|
|
||||||
unzip -q "$immich_zip"
|
|
||||||
mv "$APP-$RELEASE"/ "$SRC_DIR"
|
|
||||||
mkdir -p "$ML_DIR"
|
mkdir -p "$ML_DIR"
|
||||||
|
rm -rf "$SRC_DIR"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "latest" "$SRC_DIR"
|
||||||
|
|
||||||
|
msg_info "Updating ${APP} web and microservices"
|
||||||
cd "$SRC_DIR"/server
|
cd "$SRC_DIR"/server
|
||||||
if [[ "$RELEASE" == "1.135.1" ]]; then
|
if [[ "$RELEASE" == "1.135.1" ]]; then
|
||||||
rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts
|
rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts
|
||||||
@ -284,13 +286,9 @@ function update_script() {
|
|||||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -f "$immich_zip"
|
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
else
|
|
||||||
msg_ok "${APP} is already at v${RELEASE}"
|
|
||||||
fi
|
|
||||||
systemctl restart immich-ml immich-web
|
systemctl restart immich-ml immich-web
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ GEO_DIR="${INSTALL_DIR}/geodata"
|
|||||||
mkdir -p "$INSTALL_DIR"
|
mkdir -p "$INSTALL_DIR"
|
||||||
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${ML_DIR}","${INSTALL_DIR}"/cache}
|
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${ML_DIR}","${INSTALL_DIR}"/cache}
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v1.135.0" "$SRC_DIR"
|
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "latest" "$SRC_DIR"
|
||||||
|
|
||||||
msg_info "Installing ${APPLICATION} (more patience please)"
|
msg_info "Installing ${APPLICATION} (more patience please)"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user