This commit is contained in:
Slaviša Arežina
2025-08-14 14:15:24 +02:00
committed by GitHub
parent 6796e609d0
commit 21c2ef2915
2 changed files with 16 additions and 15 deletions

View File

@@ -23,25 +23,29 @@ function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/bin/zot ]]; then
msg_error "No ${APP} installation found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
if [[ ! -f ~/.${APP} ]] || [[ "${RELEASE}" != "$(cat ~/.${APP})" ]]; then
msg_info "Stopping Zot service"
systemctl stop zot
msg_ok "Stopped Zot service"
msg_info "Updating Zot to ${RELEASE}"
curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot
chmod +x /usr/bin/zot
rm -f /usr/bin/zot
fetch_and_deploy_gh_release "zot" "project-zot/zot" "singlefile" "latest" "/usr/bin" "zot-linux-amd64"
msg_info "Configuring Zot Registry"
chown root:root /usr/bin/zot
echo "${RELEASE}" >~/.${APP}
systemctl restart zot
msg_ok "Updated Zot to ${RELEASE}"
msg_ok "Configured Zot Registry"
msg_info "Starting service"
systemctl start zot
msg_ok "Service started"
msg_ok "Updated successfuly"
else
msg_ok "Zot is already up to date (${RELEASE})"
fi