Jenkins Port 변경하기_최신판 (젠킨스 2.332 버전 이상이라면 봐야함)
이전에 CI/CD 환경은 여러번 구축해보았지만 최근 외주 프로젝트 서버 내 CI/CD 환경을 구축해보면서 겪은 일이다. (서버 OS는 우분투 18.04)
젠킨스는 기본 포트를 8080으로 쓰고 있어 포트가 중복될 확률이 좀 높은 편이다. (대표적으로 톰캣) 그래서 이전에 구축할 당시에는 아래 이동욱님 블로그처럼 설정파일에서 포트번호를 변경해주었었다.
https://jojoldu.tistory.com/354
하지만 위 방식대로 몇번을 해보고 잘못한 부분이 없는지 여러번 체크를 해보았음에도 포트번호는 여전히 변경되지 않았다.
국내외 블로그 및 자료들을 리서치를 해보아도 이와 관련된 내용이 나오지 않았으며, 혹시 젠킨스 버전이 업그레이드되면서 해당 설정 관련해서 변경이 되었는지 찾아보았다.
https://www.jenkins.io/changelog/
한참 리서칭해본 결과, 포트 설정 관련하여 유의미해보이는 로그와 이슈 내역을 찾게 되었고, 이슈 커밋이 2.339버전 릴리즈에 앞서 병합된 것을 확인하였다.
https://github.com/jenkinsci/packaging/pull/296/files
https://issues.jenkins.io/browse/JENKINS-68007
이에 해당하는 수정은 위 링크에서와 같이 젠킨스 하위의 override.conf에 해당내용을 작성, 반영해주면 된다. 즉, 각 OS에 해당하는 경로로 이동, override.conf 내 [service] 부분에 포트를 명시해주면 된다.
자세한 내용은 아래 링크를 가져왔으니 참조하면 될 것 같다.
[Service]
Environment="JENKINS_PORT=9999"
https://www.jenkins.io/doc/book/system-administration/systemd-services/
맨처음에는 기존에 알던대로 빠르게 세팅해야지 했으나 되지 않아 당황스러웠는데 사용하는 프로덕트나 기술에 발전에 있어 알고 있는 내용임에도 적용이 안될 수 있다는 점을 다시 한번 되새기게 되었다.
즉, 개발자로서의 숙명...항상 해보고 새롭게 배움을 얻어야된다는 것을 다시금 일깨우는 계기가 되었다.
끝!