refactor: make update.sh user-agnostic by pulling via HTTPS

This commit is contained in:
2026-05-28 08:47:56 +07:00
parent c2a5857f62
commit 42b59e10bf
+5 -12
View File
@@ -37,19 +37,12 @@ fi
log "Configuring git safe directory" log "Configuring git safe directory"
git config --global --add safe.directory "$INSTALL_DIR" || true git config --global --add safe.directory "$INSTALL_DIR" || true
# 4. Pull changes using the deploy key # 4. Configure git remote and pull latest changes
log "Pulling latest changes from Gitea" log "Configuring git remote to HTTPS"
SSH_KEY="/home/fabritsky/.ssh/gitea_corp_address_book_ed25519" git remote set-url origin https://git.h0melab.ru/fabritsky/corp-address-book.git
if [ ! -f "$SSH_KEY" ]; then
# Fallback: search for any deploy/private key in fabritsky's .ssh directory
SSH_KEY_FOUND=$(find /home/fabritsky/.ssh/ -type f \( -name "*gitea*" -o -name "*ed25519*" -o -name "*rsa*" \) ! -name "*.pub" | head -n 1)
if [ -n "$SSH_KEY_FOUND" ]; then
SSH_KEY="$SSH_KEY_FOUND"
fi
fi
log "Using SSH key: ${SSH_KEY}" log "Pulling latest changes from Gitea via HTTPS"
GIT_SSH_COMMAND="ssh -i ${SSH_KEY} -o StrictHostKeyChecking=no -o BatchMode=yes" git pull git pull --ff-only origin main
# 5. Build Docker Image (Re-compile frontend and backend inside container) # 5. Build Docker Image (Re-compile frontend and backend inside container)
log "Building updated Docker image ${IMAGE_NAME}" log "Building updated Docker image ${IMAGE_NAME}"