Gerrit repository 생성

  1. admin 로그인

  2. Browse → Repository

  3. Create New

    1. Repository Name: gitlab repo name과 동일 (대소문자 구분)
    2. Create initial empty commit: false
  4. GitLab repo access token 생성

    1. Maintainer 역할
    2. read_repository, write_repository 권한
  5. gerrit replication 설정

    # /opt/gerrit/etc/replication.config
    
    [remote "repository_name"]
            url = <https://lab.ssafy.com/cheesecat47/repository_name>
            push = +refs/heads/*:refs/heads/*
            push = +refs/tags/*:refs/tags/*
            mirror = true
            projects = repository_name
    
    # /opt/gerrit/etc/secure.config
    
    [remote "repository_name"]
            username = token_name
            password = token
    
  6. sudo systemctl restart gerrit

  7. git remote set-url origin "<https://your_id@host>:port/a/repository_name"

GitLab - Jenkins 연동

  1. Git 플러그인 설치돼있는지 확인

    Untitled

  2. Credential 생성

    Untitled

    Untitled

  3. 새로운 Item 등록하기

    Untitled

    Untitled

Jenkinsfile 작성

Jenkinsfile 을 이용한 젠킨스 Pipeline 설정

Untitled