[feat]: migrate all update_scripts to new version helper (gh) (#7262)

* first migrations

* finalize

* add fix kometa inside function
This commit is contained in:
CanbiZ
2025-08-29 12:27:24 +02:00
committed by GitHub
parent 54b59e24ca
commit 9305a4ca85
145 changed files with 1041 additions and 1656 deletions

View File

@@ -27,8 +27,7 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/benjaminjonard/koillection/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f ~/.koillection ]] || [[ "${RELEASE}" != "$(cat ~/.koillection)" ]]; then
if check_for_gh_release "koillection" "benjaminjonard/koillection"; then
msg_info "Stopping Service"
systemctl stop apache2
msg_ok "Stopped Service"
@@ -36,10 +35,10 @@ function update_script() {
msg_info "Creating a backup"
mv /opt/koillection/ /opt/koillection-backup
msg_ok "Backup created"
fetch_and_deploy_gh_release "koillection" "benjaminjonard/koillection"
msg_info "Updating ${APP} to v${RELEASE}"
msg_info "Updating ${APP}"
cd /opt/koillection
cp -r /opt/koillection-backup/.env.local /opt/koillection
cp -r /opt/koillection-backup/public/uploads/. /opt/koillection/public/uploads/
@@ -51,7 +50,7 @@ function update_script() {
$STD yarn install
$STD yarn build
chown -R www-data:www-data /opt/koillection/public/uploads
msg_ok "Updated $APP to v${RELEASE}"
msg_ok "Updated $APP"
msg_info "Starting Service"
systemctl start apache2
@@ -60,10 +59,7 @@ function update_script() {
msg_info "Cleaning up"
rm -r /opt/koillection-backup
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
}