20 lines
742 B
Python
20 lines
742 B
Python
import subprocess
|
|
import os
|
|
|
|
repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
# @@ -> %40%40 (Codificação URL padrão para caracteres especiais)
|
|
remote_url = "https://admtracksteel:%40%40Gi05Br;;@git.reifonas.cloud/admtracksteel/RDO.git"
|
|
|
|
def run_git(args):
|
|
result = subprocess.run(["git"] + args, cwd=repo_dir, capture_output=True, text=True)
|
|
if result.returncode != 0:
|
|
print(f"Erro em git {' '.join(args)}: {result.stderr}")
|
|
else:
|
|
print(f"Sucesso em git {' '.join(args)}")
|
|
return result.returncode
|
|
|
|
run_git(["remote", "set-url", "origin", remote_url])
|
|
run_git(["branch", "-M", "main"])
|
|
print("Iniciando Push de RDO para Gitea...")
|
|
run_git(["push", "-u", "origin", "main", "--force"])
|