fix: log sync repository targets #32
12
sync.py
12
sync.py
|
|
@ -22,6 +22,12 @@ from src.base.code import LogType
|
|||
from src.common.repo import Repo, RepoType
|
||||
|
||||
|
||||
def _safe_repo_address(address: Optional[str]) -> Optional[str]:
|
||||
if not address:
|
||||
return address
|
||||
return re.sub(r"//[^/@]+@", "//", address)
|
||||
|
||||
|
||||
async def apply_diff(project, job, pull: PullRequestDTO, dir):
|
||||
organization, repo = github.transfer_github_to_name(project.github_address)
|
||||
|
||||
|
|
@ -251,6 +257,12 @@ async def sync_inter_code(project, job):
|
|||
async def sync_oneway_inter_code(project: ProjectDTO, job: JobDTO):
|
||||
service = JobService()
|
||||
await Log(LogType.INFO, "Sync the job code to outer", job.id)
|
||||
await Log(LogType.INFO, f"The source repo is {_safe_repo_address(project.gitlab_address)}", job.id)
|
||||
await Log(LogType.INFO, f"The GitHub target repo is {_safe_repo_address(project.github_address)}", job.id)
|
||||
if project.gitee_address:
|
||||
await Log(LogType.INFO, f"The Gitee target repo is {_safe_repo_address(project.gitee_address)}", job.id)
|
||||
if project.code_china_address:
|
||||
await Log(LogType.INFO, f"The CodeChina target repo is {_safe_repo_address(project.code_china_address)}", job.id)
|
||||
dir = f"/data/1/tmp/{job.project}_job_outer_{job.id}"
|
||||
await Log(LogType.INFO, f"The sync work dir is {dir}", job.id)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue