28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
"""5개 repo Jenkinsfile → Gitea push"""
|
|
import subprocess, sys
|
|
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
|
|
REPOS = ["zioinfo-web", "guardia-itsm", "guardia-manager", "guardia-messenger", "guardia-docs"]
|
|
BASE = "C:/GUARDiA/repos"
|
|
GITEA = "http://zio:Zio%40Admin2026%21@101.79.17.164:3000/zio"
|
|
|
|
ok, fail = [], []
|
|
for repo in REPOS:
|
|
path = f"{BASE}/{repo}"
|
|
# remote 설정
|
|
subprocess.run(['git', '-C', path, 'remote', 'remove', 'origin'],
|
|
capture_output=True)
|
|
subprocess.run(['git', '-C', path, 'remote', 'add', 'origin', f"{GITEA}/{repo}.git"],
|
|
capture_output=True)
|
|
# push
|
|
r = subprocess.run(['git', '-C', path, 'push', '-u', 'origin', 'main', '--force'],
|
|
capture_output=True, text=True, encoding='utf-8', errors='replace')
|
|
if r.returncode == 0:
|
|
print(f" ✅ {repo} push 완료")
|
|
ok.append(repo)
|
|
else:
|
|
print(f" ❌ {repo} push 실패: {r.stderr[:200]}")
|
|
fail.append(repo)
|
|
|
|
print(f"\n완료: {len(ok)}/5 실패: {fail}")
|