모든 강의 이미지 출처는 [인프런] 쿠버네티스 어나더 클래스(지상편) - Spring 1,2 입니다.
▶ App 생성
Application Name : api-tester-2232-build-push-git
Repository URL : https://github.com/<Github-Username>/kubernetes-anotherclass-sprint2.git
Revision : main
Path : 2232-build-push-git/deploy/helm/api-tester
▶ App 생성 후 자동 배포 설정 (Enable Auto-Sync)
▶ Jenkins에 Github Token 등록
Kind : Username with password
Scope : Global
Username : <Github-Username>
Password : <Github에서 발급 받은 토큰>
ID : github_token
Description : Github 업데이트 토큰
위 작업을 해주지 않으면 Jenkins에서 해당 Github Repo에 대한 권한이 없어 빌드 시 아래와 같은 403 에러 로그를 확인할 수 있다.
▶ Jeknins에서 Source/Container 빌드 후 Docker로 업로드
Definition : Pipeline script from SCM
Definition > SCM : Git
Definition > SCM > Repositories > Repository URL : https://github.com/<Github_Username>/kubernetes-anotherclass-sprint2.git
Definition > SCM > Branches to build > Branch Specifier : */main
Definition > SCM > Branches to build > Additional Behaviours > Sparse Checkout paths > Path : 2232-build-push-git
Definition > Script Path : 2232-build-push-git/Jenkinsfile