--mirror 옵션이 없음으로 대용 옵션으로 처리
This commit is contained in:
@@ -31,7 +31,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
echo "Refreshing mirror repos on 172.16.10.191 ..."
|
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 --mirror --prune); done'
|
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'
|
||||||
|
|
||||||
- name: Backup Branches (pre-scan → decision → execution)
|
- name: Backup Branches (pre-scan → decision → execution)
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -259,7 +259,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Refreshing cache for ${source_repo}"
|
echo "Refreshing cache for ${source_repo}"
|
||||||
if ! git -C "${cache_dir}" fetch --progress --mirror --prune; then
|
if ! git -C "${cache_dir}" fetch --progress --prune --prune-tags origin "+refs/*:refs/*"; then
|
||||||
echo "::warning::Failed to refresh cache for ${source_repo} (${SOURCE_SSH_HOST}:${source_repo})"
|
echo "::warning::Failed to refresh cache for ${source_repo} (${SOURCE_SSH_HOST}:${source_repo})"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -594,60 +594,61 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
REPORT_DIR="${REPORT_DIR:-${{ github.workspace }}/backup_reports}"
|
REPORT_DIR="${REPORT_DIR:-${GITHUB_WORKSPACE}/backup_reports}"
|
||||||
TS="${REPORT_TS:-}"
|
TS="${REPORT_TS:-}"
|
||||||
if [[ -z "${TS}" ]]; then
|
if [[ -z "${TS}" ]]; then
|
||||||
TS=$(ls -t ${REPORT_DIR}/decisions_*.log 2>/dev/null | head -1 | sed -E 's/.*decisions_([0-9_]+)\\.log/\\1/')
|
TS=$(ls -t ${REPORT_DIR}/decisions_*.log 2>/dev/null | head -1 | sed -E 's/.*decisions_([0-9_]+)\.log/\1/')
|
||||||
fi
|
|
||||||
if [[ -z "${TS}" ]]; then
|
|
||||||
echo "::error::No report timestamp found; cannot build report."
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
DECISIONS_LOG="${REPORT_DIR}/decisions_${TS}.log"
|
DECISIONS_LOG="${REPORT_DIR}/decisions_${TS}.log"
|
||||||
TIMINGS_LOG="${REPORT_DIR}/timings_${TS}.log"
|
TIMINGS_LOG="${REPORT_DIR}/timings_${TS}.log"
|
||||||
REPORT_MD="${REPORT_DIR}/report_${TS}.md"
|
REPORT_MD="${REPORT_DIR}/report_${TS}.md"
|
||||||
SOURCE_SSH_HOST="${SOURCE_SSH_HOST:-${{ env.SOURCE_SSH_HOST }}}"
|
SOURCE_SSH_HOST="${SOURCE_SSH_HOST:-}"
|
||||||
|
|
||||||
if [[ ! -f "${DECISIONS_LOG}" || ! -f "${TIMINGS_LOG}" ]]; then
|
|
||||||
echo "::error::Missing decisions or timings log."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
total=0; success=0; skip=0; error=0
|
|
||||||
while IFS='|' read -r sr br al rr sc tc dc st se de ee xe dt dexe nt; do
|
|
||||||
[[ -z "${sr}" ]] && continue
|
|
||||||
((total++))
|
|
||||||
case "${st}" in
|
|
||||||
success) ((success++)) ;;
|
|
||||||
skip) ((skip++)) ;;
|
|
||||||
error) ((error++)) ;;
|
|
||||||
esac
|
|
||||||
done < "${TIMINGS_LOG}"
|
|
||||||
|
|
||||||
SUMMARY_TS=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z')
|
SUMMARY_TS=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z')
|
||||||
|
total=0; success=0; skip=0; error=0
|
||||||
|
if [[ -f "${TIMINGS_LOG}" ]]; then
|
||||||
|
while IFS='|' read -r sr br al rr sc tc dc st se de ee xe dt dexe nt; do
|
||||||
|
[[ -z "${sr}" ]] && continue
|
||||||
|
((total++))
|
||||||
|
case "${st}" in
|
||||||
|
success) ((success++)) ;;
|
||||||
|
skip) ((skip++)) ;;
|
||||||
|
error) ((error++)) ;;
|
||||||
|
esac
|
||||||
|
done < "${TIMINGS_LOG}"
|
||||||
|
fi
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "# Git Backup Report"
|
echo "# Git Backup Report"
|
||||||
echo ""
|
echo ""
|
||||||
echo "- Generated: ${SUMMARY_TS}"
|
echo "- Generated: ${SUMMARY_TS}"
|
||||||
echo "- Run ID: ${GITHUB_RUN_ID:-local}"
|
echo "- Run ID: ${GITHUB_RUN_ID:-local}"
|
||||||
echo "- Source host: ${SOURCE_SSH_HOST}"
|
[[ -n "${SOURCE_SSH_HOST}" ]] && echo "- Source host: ${SOURCE_SSH_HOST}"
|
||||||
echo "- Total: ${total} (success ${success}, skip ${skip}, error ${error})"
|
echo "- Total: ${total} (success ${success}, skip ${skip}, error ${error})"
|
||||||
echo ""
|
echo ""
|
||||||
echo "## Decisions (all)"
|
echo "## Decisions (all)"
|
||||||
echo "|source_repo|branch|alias|resolved_repo|source_commit|target_commit|decision|note|"
|
echo "|source_repo|branch|alias|resolved_repo|source_commit|target_commit|decision|note|"
|
||||||
echo "|---|---|---|---|---|---|---|---|"
|
echo "|---|---|---|---|---|---|---|---|"
|
||||||
while IFS='|' read -r sr br al rr sc tc dc nt; do
|
if [[ -f "${DECISIONS_LOG}" ]]; then
|
||||||
[[ -z "${sr}" ]] && continue
|
while IFS='|' read -r sr br al rr sc tc dc nt; do
|
||||||
printf "|%s|%s|%s|%s|%s|%s|%s|%s|\n" "$sr" "$br" "$al" "$rr" "$sc" "$tc" "$dc" "$nt"
|
[[ -z "${sr}" ]] && continue
|
||||||
done < "${DECISIONS_LOG}"
|
printf "|%s|%s|%s|%s|%s|%s|%s|%s|\n" "$sr" "$br" "$al" "$rr" "$sc" "$tc" "$dc" "$nt"
|
||||||
|
done < "${DECISIONS_LOG}"
|
||||||
|
else
|
||||||
|
echo "|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|"
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "## Timings (all)"
|
echo "## Timings (all)"
|
||||||
echo "|source_repo|branch|alias|resolved_repo|source_commit|target_commit|decision|status|start_epoch|decision_epoch|exec_start_epoch|exec_end_epoch|duration_total(s)|duration_exec(s)|note|"
|
echo "|source_repo|branch|alias|resolved_repo|source_commit|target_commit|decision|status|start_epoch|decision_epoch|exec_start_epoch|exec_end_epoch|duration_total(s)|duration_exec(s)|note|"
|
||||||
echo "|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|"
|
echo "|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|"
|
||||||
while IFS='|' read -r sr br al rr sc tc dc st se de ee xe dt dexe nt; do
|
if [[ -f "${TIMINGS_LOG}" ]]; then
|
||||||
[[ -z "${sr}" ]] && continue
|
while IFS='|' read -r sr br al rr sc tc dc st se de ee xe dt dexe nt; do
|
||||||
printf "|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|\n" "$sr" "$br" "$al" "$rr" "$sc" "$tc" "$dc" "$st" "$se" "$de" "$ee" "$xe" "$dt" "$dexe" "$nt"
|
[[ -z "${sr}" ]] && continue
|
||||||
done < "${TIMINGS_LOG}"
|
printf "|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|\n" "$sr" "$br" "$al" "$rr" "$sc" "$tc" "$dc" "$st" "$se" "$de" "$ee" "$xe" "$dt" "$dexe" "$nt"
|
||||||
|
done < "${TIMINGS_LOG}"
|
||||||
|
else
|
||||||
|
echo "|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|(missing)|"
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
} > "${REPORT_MD}"
|
} > "${REPORT_MD}"
|
||||||
echo "Report generated at ${REPORT_MD}"
|
echo "Report generated at ${REPORT_MD}"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
echo "Refreshing mirror repos on 172.16.10.191 ..."
|
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 --mirror --prune); done'
|
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'
|
||||||
|
|
||||||
- name: Mirror Branches
|
- name: Mirror Branches
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user