오늘은 git에 코드를 push 하면 jekins에서 확인하고 build를 돌릴 수 있도록 하는 것이 목표이다!
일단 docker에 jenkins를 띄우고 나서 git에서 webhook이나 폴링으로 jenkins에서 빌드하는 과정을 살펴볼꺼다!
근데 그전에 docker를 jenkins에 띄워보자!
docker에 jenkins를 띄우기 전에 알고있으면 좋은 개념!
Stable (LTS) vs Weekly releases
- LTS 특징: LTS는 장기 지원 버전을 의미한다. 일반 버전과 달리 안정성에 중점을 두고, 보안 업데이트 지원 기간이 길지만 기능 업데이트는 최소화 되거나 아예 없다!
LTS Release Line
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
www.jenkins.io
- Weekly releases 특징: 버그 수정과 새로운 기능을 필요로 하는 사용자와 플러그인 개발자에게 빠르게 배포가 되지만 지원 서비스가 제공되는 기간이 LTS 보다는 짧을 수 있다.
Weekly Release Line
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
www.jenkins.io
Docker window 설치
설치 페이지: https://docs.docker.com/desktop/setup/install/windows-install/
Windows
Get started with Docker for Windows. This guide covers system requirements, where to download, and instructions on how to install and update.
docs.docker.com
설치 후 docker window (나는 이미 설치하고 쓰고있어서 컨테이너가 2개가 있다!)
Docker compose 작성
이제 프로젝트를 세팅중이여서 별거 없지만 compose.yaml에 jenkins 설정을 작성하자!
services:
jenkins:
image: jenkins/jenkins:latest
container_name: jenkins
ports:
- "8080:8080" # Jenkins UI
- "50000:50000" # Jenkins slave
volumes:
- jenkins_home:/var/jenkins_home # Jenkins 데이터 유지
- /var/run/docker.sock:/var/run/docker.sock # Docker API 연동
environment:
JAVA_OPTS: "-Djenkins.install.runSetupWizard=false" # 초기 설정 비활성화 (선택사황)
volumes:
jenkins_home:
Docker 배포 및 Jenkins 실행 확인!
인텔리제이는 아주 친철하게 저 초록 세모를 누르면 알아서 배포를 해준다! (커뮤니티버전은 잘 모르겠다...!)
배포가 정상적으로 됐다면 docker를 실행해보자! 뭔가 초록불이 다 떴다!
docker window도 확인해보자!
굿굿! 다 잘 떴다!
혹시 안떴다면!
docker 컨테이너 확인하기
docker ps
jenkins log 확인하기
docker logs jenkins
Jenkins 접속하기
http://localhost:8080/
아주 간단하게 docker에 jenkins를 올려보았다!
사실 중간에 뭐 해보려고 하다가 안돼서 내용 다 지우고 쓰고를 반복했다 슬프다 아무도 모르겠지만 나름 공부가 되었다!
** 그냥 하루하루 개인 공부한 것을 끄적 거리는 공간입니다.
이곳 저곳에서 구글링한 것과 강의 들은 내용이 정리가 되었습니다.
그림들은 그림밑에 출처표시를 해놓았습니다.
문제가 될시 말씀해주시면 해당 부분은 삭제 하도록하겠습니다. **
'개발일기 > project' 카테고리의 다른 글
[Troubleshooting] #4 docker로 띄운 elasticsearch 노드 구성 (0) | 2025.02.05 |
---|---|
[Troubleshooting] #3 Test case 작성 에러 (0) | 2025.01.26 |
[Troubleshooting] #2 JPA의 동작과 WARN 레벨 로그 수정 (0) | 2025.01.14 |
[Troubleshooting] #1 Docker로 Elasticsearch node 2개 띄우기 (1) | 2025.01.13 |
[Jenkins] Docker로 띄운 Jenkins에 git 연결하기 (0) | 2025.01.11 |
댓글