본문 바로가기

기타

[git] gitlab ssh를 사용하여 미러링 구성(gitlab 리포지토리 미러링)

728x90

gitlab ssh를 사용하여 미러링 구성(gitlab 리포지토리 미러링)

[구성]

원본 리포지토리 : gitlab-mirror-source

미러 리포지토리 : gitlab-mirror-target

원본 리포지토리 저장소 설정

프로젝트 > gitlab-mirror-source > 저장소 설정

- 미러 리포지토리 SSH URL 필요

미러링 저장소 설정

- Git repository URL(Git 저장소 URL)

- Mirror direction(미러 방향)

- Detect Host Keys(호스트 키 발견)

- Authentication method(인증 방법)

미러링 설정 완료

미러 리포지토리 저장소 설정

프로젝트 > gitlab-mirror-target > 저장소 설정

- 원본 리포지토리에서 생성된 SSH 공개 키 복사

Deploy keys 설정

- Title(제목)
- Key(Key)
- Grant write permissions to this key

배포 키 설정 완료

원격 저장소에서 미러링된 저장소 업데이트

<원격 저장소 업데이트 전>
<원격 저장소 업데이트 후>

 


생각해보기!!

저장소 gitlab-mirror-source를 저장소 gitlab-mirror-target로 옮기기

git clone --mirror gitlab_url

git clone --mirror https://gitlab.com/gitlab-mirror-source.git

git push --mirror gitlab_url

git push --mirror https://gitlab.com/gitlab-mirror-target.git

미러 업데이트

미러 리포지토리가 업데이트되면 모든 새 브랜치, 태그 및 커밋이 프로젝트의 활동 피드에 표시됩니다. GitLab의 리포지토리 미러는 자동으로 업데이트됩니다. 업데이트를 수동으로 트리거할 수도 있습니다.

- GitLab.com에서 최대 5분에 한 번.

- 자체 관리형 인스턴스에서 관리자가 설정한 풀 미러링 간격 제한 에 따릅니다.

 

참고URL

- Pull Mirroring Interval : https://docs.gitlab.com/ee/administration/instance_limits.html#pull-mirroring-interval

- https://docs.gitlab.com/ee/user/project/repository/mirror/

- https://gitlab.com/gitlab-org/gitlab/-/issues/216625

- https://scbyun.com/703

 

728x90