diff --git a/update.sh b/update.sh index 7a4c1e7..6bf8f5c 100755 --- a/update.sh +++ b/update.sh @@ -37,19 +37,12 @@ fi log "Configuring git safe directory" git config --global --add safe.directory "$INSTALL_DIR" || true -# 4. Pull changes using the deploy key -log "Pulling latest changes from Gitea" -SSH_KEY="/home/fabritsky/.ssh/gitea_corp_address_book_ed25519" -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 +# 4. Configure git remote and pull latest changes +log "Configuring git remote to HTTPS" +git remote set-url origin https://git.h0melab.ru/fabritsky/corp-address-book.git -log "Using SSH key: ${SSH_KEY}" -GIT_SSH_COMMAND="ssh -i ${SSH_KEY} -o StrictHostKeyChecking=no -o BatchMode=yes" git pull +log "Pulling latest changes from Gitea via HTTPS" +git pull --ff-only origin main # 5. Build Docker Image (Re-compile frontend and backend inside container) log "Building updated Docker image ${IMAGE_NAME}"