feature/auto-update-forgejo #2

Merged
jdaily merged 12 commits from feature/auto-update-forgejo into main 2025-03-24 01:46:34 +00:00
Showing only changes of commit 8147fcaf90 - Show all commits

View file

@ -78,6 +78,7 @@ get_current_version() {
# Update Forgejo to the latest version # Update Forgejo to the latest version
update_forgejo() { update_forgejo() {
local latest_version=$1 local latest_version=$1
local image_name="codeberg.org/forgejo/forgejo"
log "Starting Forgejo update process..." log "Starting Forgejo update process..."
@ -92,11 +93,11 @@ update_forgejo() {
# Pull the latest image # Pull the latest image
log "Pulling the latest Forgejo image..." log "Pulling the latest Forgejo image..."
docker pull "codeberg.org/forgejo/forgejo:$latest_version" docker pull "$image_name:$latest_version"
# Update the docker-compose file with the new version # Update the docker-compose file with the new version
log "Updating docker-compose.yml with the new version..." log "Updating docker-compose.yml with the new version..."
sed -i "s/codeberg.org\/forgejo\/forgejo:[0-9.]*\+*/codeberg.org\/forgejo\/forgejo:$latest_version/g" "$COMPOSE_FILE" sed -i "s|codeberg.org/forgejo/forgejo:[0-9.]*\+*|$image_name:$latest_version|g" "$COMPOSE_FILE"
# Restart Forgejo with the new version # Restart Forgejo with the new version
log "Restarting Forgejo with the new version..." log "Restarting Forgejo with the new version..."