This commit is contained in:
CanbiZ 2025-07-25 10:58:39 +02:00
parent be83b85e40
commit 5ad7379bf0
2 changed files with 7 additions and 10 deletions

View File

@ -30,7 +30,6 @@ function update_script() {
fi fi
if check_for_update "${APP}" "keycloak/keycloak"; then if check_for_update "${APP}" "keycloak/keycloak"; then
local release="$CHECK_UPDATE_RELEASE"
msg_info "Stopping ${APP}" msg_info "Stopping ${APP}"
systemctl stop keycloak systemctl stop keycloak
@ -47,7 +46,7 @@ function update_script() {
tar -czf keycloak_conf_backup.tar.gz keycloak.old/conf tar -czf keycloak_conf_backup.tar.gz keycloak.old/conf
msg_ok "Backup done" msg_ok "Backup done"
fetch_and_deploy_gh_release "keycloak" "keycloak/keycloak" "prebuild" "$release" "/opt/keycloak" "keycloak-*.tar.gz" fetch_and_deploy_gh_release "keycloak" "keycloak/keycloak" "prebuild" "latest" "/opt/keycloak" "keycloak-*.tar.gz"
msg_info "Updating ${APP}" msg_info "Updating ${APP}"
cd /opt cd /opt
@ -57,12 +56,10 @@ function update_script() {
rm -rf keycloak.old rm -rf keycloak.old
msg_ok "Updated ${APP} LXC" msg_ok "Updated ${APP} LXC"
echo "${release}" >~/.keycloak
msg_info "Restarting Keycloak" msg_info "Restarting Keycloak"
systemctl restart keycloak systemctl restart keycloak
msg_ok "Restarted Keycloak" msg_ok "Restarted Keycloak"
msg_ok "Update to v${release} successful" msg_ok "Update successful"
fi fi
exit 0 exit 0

View File

@ -2006,7 +2006,7 @@ check_for_update() {
jq -r '.tag_name' | sed 's/^v//') jq -r '.tag_name' | sed 's/^v//')
# DEBUG # DEBUG
echo "[DEBUG] Latest release fetched: '${release}'" #echo "[DEBUG] Latest release fetched: '${release}'"
if [[ -z "$release" ]]; then if [[ -z "$release" ]]; then
msg_error "Unable to determine latest release for ${app}" msg_error "Unable to determine latest release for ${app}"
@ -2019,15 +2019,15 @@ check_for_update() {
fi fi
# DEBUG # DEBUG
echo "[DEBUG] Current file: '${current_file}'" #echo "[DEBUG] Current file: '${current_file}'"
echo "[DEBUG] Current version read: '${current}'" #echo "[DEBUG] Current version read: '${current}'"
if [[ "$release" != "$current" ]] || [[ ! -f "$current_file" ]]; then if [[ "$release" != "$current" ]] || [[ ! -f "$current_file" ]]; then
echo "[DEBUG] Decision: Update required (release='${release}' current='${current}')" #echo "[DEBUG] Decision: Update required (release='${release}' current='${current}')"
CHECK_UPDATE_RELEASE="$release" CHECK_UPDATE_RELEASE="$release"
return 0 return 0
else else
echo "[DEBUG] Decision: No update (release='${release}' current='${current}')" #echo "[DEBUG] Decision: No update (release='${release}' current='${current}')"
msg_ok "${app} is up to date (v${release})" msg_ok "${app} is up to date (v${release})"
return 1 return 1
fi fi