From e582a3f3b338f9bd6c250304de6d4d6e4a7e20d7 Mon Sep 17 00:00:00 2001 From: Lectom C Han Date: Fri, 19 Dec 2025 17:14:43 +0900 Subject: [PATCH] =?UTF-8?q?--progress=20=EC=A0=9C=EA=B1=B0.=20report=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9D=80=20=EC=B2=B4=ED=81=AC=ED=95=B4?= =?UTF-8?q?=EC=95=BC=ED=95=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/backup.yml | 16 +++++++--------- .../{mirror.yml => single_branch_backup.yml} | 12 +++++------- 2 files changed, 12 insertions(+), 16 deletions(-) rename .gitea/workflows/{mirror.yml => single_branch_backup.yml} (94%) diff --git a/.gitea/workflows/backup.yml b/.gitea/workflows/backup.yml index 3fb93e8..f1e2d4d 100644 --- a/.gitea/workflows/backup.yml +++ b/.gitea/workflows/backup.yml @@ -31,7 +31,7 @@ jobs: run: | set -euo pipefail echo "Refreshing mirror repos on 172.16.10.191 ..." - ssh engdev@172.16.10.191 'set -euo pipefail; export GIT_PROGRESS_DELAY=0 GIT_FLUSH=1; shopt -s nullglob; for repo in *.git; do [ -d "${repo}" ] || continue; echo "Updating ${repo}"; (cd "${repo}" && git fetch --progress --prune --prune-tags origin "+refs/*:refs/*"); done' + ssh engdev@172.16.10.191 'set -euo pipefail; shopt -s nullglob; for repo in *.git; do [ -d "${repo}" ] || continue; echo "Updating ${repo}"; (cd "${repo}" && git fetch --prune --prune-tags origin "+refs/*:refs/*"); done' - name: Backup Branches (pre-scan → decision → execution) continue-on-error: true @@ -53,8 +53,6 @@ jobs: NOTIFY_WEBHOOK="${NOTIFY_WEBHOOK:-}" SYNC_TAGS="${SYNC_TAGS:-true}" TARGET_SEED_DEPTH="${TARGET_SEED_DEPTH:-50}" - export GIT_PROGRESS_DELAY=0 - export GIT_FLUSH=1 if ! [[ "${TARGET_SEED_DEPTH}" =~ ^[0-9]+$ ]] || (( TARGET_SEED_DEPTH <= 0 )); then echo "::warning::TARGET_SEED_DEPTH(${TARGET_SEED_DEPTH}) is invalid; resetting to 50" TARGET_SEED_DEPTH=50 @@ -253,13 +251,13 @@ jobs: local source_repo="$1" cache_dir="${CACHE_BASE}/${source_repo//\//_}.git" if [[ ! -d "${cache_dir}" ]]; then echo "Initializing local cache for ${source_repo} at ${cache_dir}" - if ! git clone --progress --mirror "${SOURCE_SSH_HOST}:${source_repo}" "${cache_dir}"; then + if ! git clone --mirror "${SOURCE_SSH_HOST}:${source_repo}" "${cache_dir}"; then echo "::warning::Failed to clone cache for ${source_repo} (${SOURCE_SSH_HOST}:${source_repo})" return 1 fi else echo "Refreshing cache for ${source_repo}" - if ! git -C "${cache_dir}" fetch --progress --prune --prune-tags origin "+refs/*:refs/*"; then + if ! git -C "${cache_dir}" fetch --prune --prune-tags origin "+refs/*:refs/*"; then echo "::warning::Failed to refresh cache for ${source_repo} (${SOURCE_SSH_HOST}:${source_repo})" return 1 fi @@ -485,7 +483,7 @@ jobs: prep_elapsed=$(( $(date +%s) - start_epoch )) echo "Prep completed in ${prep_elapsed}s. Fetching latest branch '${branch_name}' from source ${FETCH_REMOTE} ..." FETCH_LOG="${CLONE_DIR}/fetch_shallow.log" - if ! git fetch --progress --no-tags "${shallow_exclude_args[@]}" source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FETCH_LOG}" >&2); then + if ! git fetch --no-tags "${shallow_exclude_args[@]}" source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FETCH_LOG}" >&2); then if [[ "${#shallow_exclude_args[@]}" -gt 0 ]]; then echo "::warning::shallow-exclude fetch failed (likely unsupported). Log: ${FETCH_LOG}" if [[ -s "${FETCH_LOG}" ]]; then @@ -494,10 +492,10 @@ jobs: fi echo "[fallback] Seeding target main depth=${TARGET_SEED_DEPTH} then retrying full fetch without shallow-exclude" SEED_LOG="${CLONE_DIR}/fetch_seed.log" - git fetch --progress --no-tags --depth="${TARGET_SEED_DEPTH}" origin "refs/heads/main:refs/heads/main" 2> >(tee "${SEED_LOG}" >&2) || echo "::warning::Seeding from target main skipped (fetch failed or branch missing)" + git fetch --no-tags --depth="${TARGET_SEED_DEPTH}" origin "refs/heads/main:refs/heads/main" 2> >(tee "${SEED_LOG}" >&2) || echo "::warning::Seeding from target main skipped (fetch failed or branch missing)" backup_mode="증분 백업 (폴백: shallow-exclude 미지원)" FULL_FETCH_LOG="${CLONE_DIR}/fetch_full.log" - if ! git fetch --progress --no-tags source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FULL_FETCH_LOG}" >&2); then + if ! git fetch --no-tags source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FULL_FETCH_LOG}" >&2); then if [[ -s "${SEED_LOG:-}" ]]; then echo "[seed stderr tail]" tail -n 40 "${SEED_LOG}" @@ -527,7 +525,7 @@ jobs: if [[ "${SYNC_TAGS}" == "true" ]]; then echo "Fetching tags from source..." - if ! git fetch --progress --prune --prune-tags --no-tags source "refs/tags/*:refs/tags/*"; then + if ! git fetch --prune --prune-tags --no-tags source "refs/tags/*:refs/tags/*"; then echo "::error::Failed to fetch tags from source repo" notify_status "error" "${repo_name}" "${branch_name}" "${backup_mode}" "${start_epoch}" "tag fetch 오류" "${heads_detail}" exec_end_epoch=$(date +%s) diff --git a/.gitea/workflows/mirror.yml b/.gitea/workflows/single_branch_backup.yml similarity index 94% rename from .gitea/workflows/mirror.yml rename to .gitea/workflows/single_branch_backup.yml index 33284a8..cd76a21 100644 --- a/.gitea/workflows/mirror.yml +++ b/.gitea/workflows/single_branch_backup.yml @@ -29,7 +29,7 @@ jobs: run: | set -euo pipefail echo "Refreshing mirror repos on 172.16.10.191 ..." - ssh engdev@172.16.10.191 'set -euo pipefail; export GIT_PROGRESS_DELAY=0 GIT_FLUSH=1; shopt -s nullglob; for repo in *.git; do [ -d "${repo}" ] || continue; echo "Updating ${repo}"; (cd "${repo}" && git fetch --progress --prune --prune-tags origin "+refs/*:refs/*"); done' + ssh engdev@172.16.10.191 'set -euo pipefail; shopt -s nullglob; for repo in *.git; do [ -d "${repo}" ] || continue; echo "Updating ${repo}"; (cd "${repo}" && git fetch --prune --prune-tags origin "+refs/*:refs/*"); done' - name: Mirror Branches env: @@ -41,8 +41,6 @@ jobs: SYNC_TAGS: ${{ vars.SYNC_TAGS }} # Optional, "false" to skip tag sync run: | set -euo pipefail - export GIT_PROGRESS_DELAY=0 - export GIT_FLUSH=1 CENTER_ORG="center_dev" AUTH_HEADER="Authorization: token ${BASE_GITEA_TOKEN}" @@ -299,7 +297,7 @@ jobs: prep_elapsed=$(( $(date +%s) - start_epoch )) echo "Prep completed in ${prep_elapsed}s. Fetching latest branch '${branch_name}' from source ${FETCH_REMOTE} ..." FETCH_LOG="${CLONE_DIR}/fetch_shallow.log" - if ! git fetch --progress --no-tags "${shallow_exclude_args[@]}" source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FETCH_LOG}" >&2); then + if ! git fetch --no-tags "${shallow_exclude_args[@]}" source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FETCH_LOG}" >&2); then if [[ "${#shallow_exclude_args[@]}" -gt 0 ]]; then echo "::warning::shallow-exclude fetch failed (likely unsupported). Log: ${FETCH_LOG}" if [[ -s "${FETCH_LOG}" ]]; then @@ -308,10 +306,10 @@ jobs: fi echo "[fallback] Seeding target main depth=${TARGET_SEED_DEPTH} then retrying full fetch without shallow-exclude" SEED_LOG="${CLONE_DIR}/fetch_seed.log" - git fetch --progress --no-tags --depth="${TARGET_SEED_DEPTH}" origin "refs/heads/main:refs/heads/main" 2> >(tee "${SEED_LOG}" >&2) || echo "::warning::Seeding from target main skipped (fetch failed or branch missing)" + git fetch --no-tags --depth="${TARGET_SEED_DEPTH}" origin "refs/heads/main:refs/heads/main" 2> >(tee "${SEED_LOG}" >&2) || echo "::warning::Seeding from target main skipped (fetch failed or branch missing)" backup_mode="증분 업데이트 (폴백: shallow-exclude 미지원)" FULL_FETCH_LOG="${CLONE_DIR}/fetch_full.log" - if ! git fetch --progress --no-tags source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FULL_FETCH_LOG}" >&2); then + if ! git fetch --no-tags source "+refs/heads/${branch_name}:refs/heads/${branch_name}" 2> >(tee "${FULL_FETCH_LOG}" >&2); then if [[ -s "${SEED_LOG:-}" ]]; then echo "[seed stderr tail]" tail -n 40 "${SEED_LOG}" @@ -336,7 +334,7 @@ jobs: fi if [[ "${SYNC_TAGS}" == "true" ]]; then echo "Fetching tags from source..." - if ! git fetch --progress --prune --prune-tags --no-tags source "refs/tags/*:refs/tags/*"; then + if ! git fetch --prune --prune-tags --no-tags source "refs/tags/*:refs/tags/*"; then echo "::error::Failed to fetch tags from source repo" notify_status "error" "${repo_name}" "${branch_name}" "${backup_mode}" "${start_epoch}" "tag fetch 오류" cd "${ROOT_DIR}"