gitlab 연동

This commit is contained in:
변정훈
2023-03-13 04:42:35 +00:00
parent 6c5e4e3ce4
commit 299ca85e92

View File

@@ -1,2 +1,29 @@
# jenkins_gitlab_cicd # jenkins with gitlab CI/CD
> jenkins와 gitlab을 활용한 CI/CD 문서입니다.<br>
https://oingdaddy.tistory.com/103 를 참고하였습니다.
## Plugin 설치
![01](./img/01.png)
- GitLab에서 commit event가 발생할 경우 Pipeline Run을 위한 Plugin 설치
## GitLab과 연결
![02](./img/02.png)
- jenkins 관리 > 시스템 설정 > Gitlab 부분에 자신의 GitLab 정보를 입력하고 저장
- Credentials 같은 경우 Add > GitLab API token 을 선택하여 GitLab에서 생성한 API token 입력
- 저장 전 Test Connection 을 눌러서 연결 확인
## Webhook 설정
![03](./img/03.png)
- Build when a change is pushed to GitLab. GitLab webhook URL: http://주소
- GitLab 설정에서 webhook 등록시 해당 주소를 입력
- 어떤 이벤트가 발생할 경우 Pipeline이 동작할 것인가 선택
- 고급 버튼을 누른후 아래쪽 Secret token의 Generate 버튼을 눌러 token 생성 및 복사
- GitLab 설정에서 webhook 등록시 해당 token을 입력하고
## GitLab Webhook 설정
![04](./img/04.png)
- GitLab 프로젝트 > 설정(Settings) > 웹훅(Webhook)
- Webhook 설정 단계에서 확인한 주소와 token을 입력
- Push events 체크
- 생성 후 하단에서 Test 실행