Improve image pulling and docker-compose update in auto-update script
This commit is contained in:
parent
5841012a5a
commit
8147fcaf90
1 changed files with 3 additions and 2 deletions
|
|
@ -78,6 +78,7 @@ get_current_version() {
|
|||
# Update Forgejo to the latest version
|
||||
update_forgejo() {
|
||||
local latest_version=$1
|
||||
local image_name="codeberg.org/forgejo/forgejo"
|
||||
|
||||
log "Starting Forgejo update process..."
|
||||
|
||||
|
|
@ -92,11 +93,11 @@ update_forgejo() {
|
|||
|
||||
# Pull the latest 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
|
||||
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
|
||||
log "Restarting Forgejo with the new version..."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue