Compare commits

..

2 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
69e7c7013d Add informational args to release checks
Pass extra informational strings to check_for_gh_release calls to surface release-specific notes. Updated ct/immich.sh (notes for Immich and VectorChord releases), ct/opencloud.sh (note for OpenCloud), and ct/plant-it.sh (note about web frontend presence). These messages clarify testing/compatibility expectations when checking/releases.
2026-03-19 17:46:29 +01:00
CanbiZ (MickLesk)
cee6a53fc6 Display pin reason in release-check messages
Add an optional pin_reason parameter to check_for_gh_release and check_for_codeberg_release and update the no-update messaging to show the provided reason. If no reason is supplied, show a default message indicating the update is temporarily held back due to issues with newer releases. This improves user feedback when versions are intentionally pinned.
2026-03-19 17:45:10 +01:00
4 changed files with 40 additions and 16 deletions

View File

@@ -110,7 +110,7 @@ EOF
fi
RELEASE="v2.5.6"
if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}"; then
if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
if [[ $(cat ~/.immich) > "2.5.1" ]]; then
msg_info "Enabling Maintenance Mode"
cd /opt/immich/app/bin
@@ -125,7 +125,7 @@ EOF
msg_ok "Stopped Services"
VCHORD_RELEASE="0.5.3"
[[ -f ~/.vchord_version ]] && mv ~/.vchord_version ~/.vectorchord
if check_for_gh_release "VectorChord" "tensorchord/VectorChord" "${VCHORD_RELEASE}"; then
if check_for_gh_release "VectorChord" "tensorchord/VectorChord" "${VCHORD_RELEASE}" "updated together with Immich after testing"; then
fetch_and_deploy_gh_release "VectorChord" "tensorchord/VectorChord" "binary" "${VCHORD_RELEASE}" "/tmp" "postgresql-16-vchord_*_amd64.deb"
systemctl restart postgresql
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vector UPDATE;"

View File

@@ -30,7 +30,7 @@ function update_script() {
fi
RELEASE="v5.2.0"
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}"; then
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
msg_info "Stopping services"
systemctl stop opencloud opencloud-wopi
msg_ok "Stopped services"

View File

@@ -29,7 +29,7 @@ function update_script() {
exit
fi
setup_mariadb
if check_for_gh_release "plant-it" "MDeLuise/plant-it" "${RELEASE}"; then
if check_for_gh_release "plant-it" "MDeLuise/plant-it" "${RELEASE}" "last version that includes the web frontend"; then
msg_info "Stopping Service"
systemctl stop plant-it
msg_info "Stopped Service"

View File

@@ -282,7 +282,7 @@ get_cached_version() {
cat "/var/cache/app-versions/${app}_version.txt"
return 0
fi
return 1
return 0
}
# ------------------------------------------------------------------------------
@@ -1100,9 +1100,8 @@ get_system_arch() {
# ------------------------------------------------------------------------------
create_temp_dir() {
local tmp_dir=$(mktemp -d)
# Callers should handle their own cleanup (rm -rf "$tmpdir")
# Do NOT set trap here — it would overwrite global traps and only fire
# when create_temp_dir() itself returns, not the calling function
# Set trap to cleanup on EXIT, ERR, INT, TERM
trap "rm -rf '$tmp_dir'" EXIT ERR INT TERM
echo "$tmp_dir"
}
@@ -2272,6 +2271,7 @@ check_for_gh_release() {
local app="$1"
local source="$2"
local pinned_version_in="${3:-}" # optional
local pin_reason="${4:-}" # optional reason shown to user
local app_lc=""
app_lc="$(echo "${app,,}" | tr -d ' ')"
local current_file="$HOME/.${app_lc}"
@@ -2445,7 +2445,11 @@ check_for_gh_release() {
return 0
fi
msg_ok "No update available: ${app} is already on pinned version (${current})"
if [[ -n "$pin_reason" ]]; then
msg_ok "No update available: ${app} (${current}) - update held back: ${pin_reason}"
else
msg_ok "No update available: ${app} (${current}) - update temporarily held back due to issues with newer releases"
fi
return 1
fi
@@ -2484,6 +2488,7 @@ check_for_codeberg_release() {
local app="$1"
local source="$2"
local pinned_version_in="${3:-}" # optional
local pin_reason="${4:-}" # optional reason shown to user
local app_lc="${app,,}"
local current_file="$HOME/.${app_lc}"
@@ -2563,7 +2568,11 @@ check_for_codeberg_release() {
return 0
fi
msg_ok "No update available: ${app} is already on pinned version (${current})"
if [[ -n "$pin_reason" ]]; then
msg_ok "No update available: ${app} (${current}) - update held back: ${pin_reason}"
else
msg_ok "No update available: ${app} (${current}) - update temporarily held back due to issues with newer releases"
fi
return 1
fi
@@ -5352,9 +5361,26 @@ function setup_java() {
"main"
fi
# Get currently installed version (use dpkg-query to avoid column truncation)
# Get currently installed version
local INSTALLED_VERSION=""
INSTALLED_VERSION=$(dpkg-query -W -f '${Package}\n' 2>/dev/null | grep -oP '^temurin-\K[0-9]+(?=-jdk$)' | head -n1 || echo "")
if dpkg -l | grep -q "temurin-.*-jdk" 2>/dev/null; then
INSTALLED_VERSION=$(dpkg -l 2>/dev/null | awk '/temurin-.*-jdk/{print $2}' | grep -oP 'temurin-\K[0-9]+' | head -n1 || echo "")
fi
# Validate INSTALLED_VERSION is not empty if JDK package found
local JDK_COUNT=0
JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || true)
if [[ -z "$INSTALLED_VERSION" && "${JDK_COUNT:-0}" -gt 0 ]]; then
msg_warn "Found Temurin JDK but cannot determine version - attempting reinstall"
# Try to get actual package name for purge
local OLD_PACKAGE
OLD_PACKAGE=$(dpkg -l 2>/dev/null | awk '/temurin-.*-jdk/{print $2}' | head -n1 || echo "")
if [[ -n "$OLD_PACKAGE" ]]; then
msg_info "Removing existing package: $OLD_PACKAGE"
$STD apt purge -y "$OLD_PACKAGE" || true
fi
INSTALLED_VERSION="" # Reset to trigger fresh install
fi
# Scenario 1: Already at correct version
if [[ "$INSTALLED_VERSION" == "$JAVA_VERSION" ]]; then
@@ -7833,8 +7859,8 @@ function setup_uv() {
local TMP_DIR=$(mktemp -d)
local CACHED_VERSION
# trap for TMP Cleanup (RETURN instead of EXIT to avoid overwriting global traps)
trap "rm -rf '$TMP_DIR'" RETURN
# trap for TMP Cleanup
trap "rm -rf '$TMP_DIR'" EXIT
CACHED_VERSION=$(get_cached_version "uv")
@@ -8104,8 +8130,6 @@ function setup_docker() {
local docker_installed=false
local portainer_installed=false
local USE_DOCKER_REPO="${USE_DOCKER_REPO:-false}"
local DOCKER_CURRENT_VERSION=""
local DOCKER_LATEST_VERSION=""
# Check if Docker is already installed
if command -v docker &>/dev/null; then