Files
Orchestrator/bahn/project-audit/scripts/git-push-only.py
ankn a5f8fb49ab Migrate all repos into monorepo context folders
Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
      Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
      Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)

Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
2026-06-30 20:39:52 +02:00

33 lines
960 B
Python

"""Nur Push (kein Stage/Commit) - testet ob oauth2-Auth den Push ermoeglicht."""
from pathlib import Path
from dulwich import porcelain
REPO_PATH = str(Path(__file__).parent.parent)
REMOTE_URL = "https://git.tech.rz.db.de/AndreKnie/project-audit.git"
secrets = {}
with open("project-audit/.secrets", "r", encoding="utf-8-sig") as f:
for line in f:
if "=" in line and not line.startswith("#"):
k, v = line.strip().split("=", 1)
secrets[k.strip()] = v.strip()
token = secrets.get("GITLAB_TOKEN_AUDIT", "")
print(f"Push mit oauth2-Auth (Token: ...{token[-4:]})")
print(f"Repo: {REPO_PATH}")
print(f"Remote: {REMOTE_URL}")
print(f"Refspec: master -> master")
print()
try:
porcelain.push(
REPO_PATH,
REMOTE_URL,
refspecs=b"refs/heads/master:refs/heads/master",
username="oauth2",
password=token
)
print("PUSH ERFOLGREICH!")
except Exception as e:
print(f"FEHLER: {e}")