Update gitea-mirror.sh

This commit is contained in:
Tobias 2025-06-04 06:40:36 +02:00 committed by GitHub
parent 9d5e124aef
commit 9685a2d2a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,8 +52,10 @@ function update_script() {
msg_info "Updating and rebuilding ${APP} to v${RELEASE}" msg_info "Updating and rebuilding ${APP} to v${RELEASE}"
cd /opt/gitea-mirror cd /opt/gitea-mirror
$STD bun install $STD bun run setup
$STD bun run build $STD bun run build
APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4)
sudo sed -i.bak "s|^Environment=npm_package_version=.*|Environment=npm_package_version=${APP_VERSION}|" /etc/systemd/system/gitea-mirror.service
msg_ok "Updated and rebuilt ${APP} to v${RELEASE}" msg_ok "Updated and rebuilt ${APP} to v${RELEASE}"
msg_info "Restoring Data" msg_info "Restoring Data"
@ -61,6 +63,7 @@ function update_script() {
msg_ok "Restored Data" msg_ok "Restored Data"
msg_info "Starting Service" msg_info "Starting Service"
systemctl daemon-reload
systemctl start gitea-mirror systemctl start gitea-mirror
msg_ok "Service Started" msg_ok "Service Started"
else else