-
[WSL] Ubuntu 18.04 에 Jenkins 설치하기IT/삽질 2024. 3. 20. 23:38
출처 : unsplash.com 새롭게 구성한 WSL2 Ubuntu 18.04 에 jenkins 를 설치해본다.
젠키스 설치 이전에 java가 설치되어 있지 않다면 java 부터 설치하자.
단, 버전에 따라 지원되는 java 버전이 상이하니 반드시 "jenkins java support policy" 키워드로 조회해보자.
( 비단 jenkins 뿐만 아니라 다른 패키지 설치 시에도 자바 정책 확인은 필수! )
참고로 2024-03-20 현재 정책은 아래에서 확인 가능!
https://www.jenkins.io/doc/book/platform-information/support-policy-java/
Java Support Policy
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
www.jenkins.io
대부분 구글에서 설치 방법 찾아보면 인스톨 전에, "jenkins key" 다운로드 위해서 하기 명령어를 수행하라고 나온다.
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
그런데 수행하면 진행되지 않고 아래와 같은 오류가 나는 경우가 있다.
GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5BA31D57EF5975CA
2023.3.28 이후에 새로운 key를 공개했다고 하니.. 위의 명령어 말고 아래 명령어 로 호출하자.
참고) https://www.jenkins.io/blog/2023/03/27/repository-signing-keys-changing/
Jenkins 2.397 and 2.387.2: New Linux Repository Signing Keys
This article announces new Linux repository signing keys. Repository signing keys will change with the release of Jenkins weekly 2.397 and Jenkins LTS 2.387.2. The previous repository signing keys will not be used after the release of Jenkins weekly 2.396.
www.jenkins.io
젠킨스 설치 전 작업
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
젠킨스 설치
apt-get update 까지 정상 수행되었다면 이제 설치만 하면 된다!
설치하기 전에 특정 버전이 설치 목록에 있는지 확인하기 위해서는 아래 명령어로 검색이 가능하다.
- 예시로 2.440 버전이 존재하는지 검색
$ sudo apt-cache madison jenkins | grep 2.440 jenkins | 2.440.1 | https://pkg.jenkins.io/debian-stable binary/ Packages
존재하는 것 확인했으니 해당 버전으로 설치 진행해보자.
만약 특정 버전이 아니고 그냥 LTS 버전으로 설치하고 싶다 하는 경우엔 sudo apt-get install jenkins 명령어를 수행하자.
$ sudo apt-get install jenkins=2.440.1 -y
참고로.. 설치가.. 느릴 수도 있다..
야간인데도 15분 가량 소요되었다.
서비스 포트 변경
설치하면 기본으로 8080 를 사용하는데, 톰캣 등 다른 was 사용 시 포트 충돌 가능성 존재하므로 포트를 변경하자.
아래 2개 파일의 PORT 값을 28080 으로 변경했다.
# 파일 백업 $ sudo cp -f /etc/default/jenkins /etc/default/jenkins_org $ sudo vi /etc/default/jenkins # HTTP_PORT 값을 28080 으로 수정 # 파일 백업 $ sudo cp -f /lib/systemd/system/jenkins.service /lib/systemd/system/jenkins.service_org $ sudo vi /lib/systemd/system/jenkins.service # JENKINS_PORT 값을 28080 으로 수정
만일 홈 디렉토리를 default 인 /var/lib/jenkins 가 아닌 다른 경로로 하고 싶다면 상기 동일 2개 파일의 내용을 수정한다.
# 파일명: /etc/default/jenkins # JENKINS_HOME=/var/lib/$NAME 값을 변경 # 파일명: /lib/systemd/system/jenkins.service # Environment="JENKINS_HOME=/var/lib/jenkins" 값을 변경 # WorkingDirectory=/var/lib/jenkins 값을 변경
설정 변경 후 적용
설정 정보를 변경한 후에는 하기 명령어를 순차 수행하자.
$ sudo systemctl daemon-reload $ sudo systemctl restart jenkins
참고: 관련 명령어
# 젠킨스 서비스 활성화 sudo systemctl enable jenkins # 젠킨스 서비스 시작 sudo systemctl start jenkins # 젠킨스 서비스 상태 보기 sudo systemctl status jenkins # 콘솔 로그 출력 journalctl -u jenkins.service
refrence)
1. 특정 버전 설치하기
https://directdevops.blog/2019/01/04/installing-specific-lts-version-of-jenkins-on-ubuntu/
Installing Specific LTS Version of Jenkins on Ubuntu - Direct DevOps from Quality Thought
Install openjdk8 Execute the following commands in order sudo apt-get update sudo apt-cache search openjdk Note: Select any suitable package from the top. This documentation selects the openjdk-8-jdk sudo apt-get install openjdk-8-jdk Prepare your system f
directdevops.blog
2. LTS 이력 확인
https://www.jenkins.io/changelog-stable/
LTS Changelog
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
www.jenkins.io
3. 새로운 repository key 확인
https://www.jenkins.io/blog/2023/03/27/repository-signing-keys-changing/
Jenkins 2.397 and 2.387.2: New Linux Repository Signing Keys
This article announces new Linux repository signing keys. Repository signing keys will change with the release of Jenkins weekly 2.397 and Jenkins LTS 2.387.2. The previous repository signing keys will not be used after the release of Jenkins weekly 2.396.
www.jenkins.io
4. jenkins 자바 지원 버전 확인
https://www.jenkins.io/doc/book/platform-information/support-policy-java/
Java Support Policy
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
www.jenkins.io
5. 우분투에서 젠킨스 설치
https://velog.io/@dohyunkim12/Ubuntu-18.04-jenkins%EC%84%A4%EC%B9%98
Ubuntu 18.04 jenkins 설치
EnvironmentUbuntu 18.04Java 8Jenkins 2.346.2java 8 or 11 version 설치sudo apt-get install openjdk-8-jre-headlessJAVA_HOME 맞게 설정되어 있는지 확인 echo $JAVA_HOME
velog.io
6. 우분투에서 젠킨스 설치
https://imbf.github.io/devops/2020/11/26/Install-Jenkins-in-Ubuntu(18.04).html
[Jenkins로 CI/CD 구축하기 - 1] Ubuntu(18.04)에 Jenkins 설치하기
이번 포스팅에서는 Ubuntu(18.04)에 Jenkins를 설치하고 환경 설정까지 하는 방법을 공유하도록 하겠습니다.
imbf.github.io
7. 윈도우 wsl 환경에서 동일 리눅스 다중 설치
https://www.sysnet.pe.kr/2/0/12878
개발 환경 구성: 617. 윈도우 WSL 환경에서 같은 종류의 리눅스를 다중으로 설치하는 방법
글쓴 사람 정성태 (techsharer at outlook.com) 홈페이지 첨부 파일 부모글 보이기/감추기 (연관된 글이 1개 있습니다.) (시리즈 글이 11개 있습니다.) 개발 환경 구성: 303. Windows 10 Bash Shell - 한글 환경을
www.sysnet.pe.kr
8. wsl -> wsl2 버전 변경
우분투 18.04 wsl 1에서 wsl 2로 변경
[1] 테스트 환경 하드웨어 : HP 노트북(모델명 : 14s-cf1035tu, cpu : i5-8265U, graphic : hd620, RAM : ddr4 12GB, 보조기억장치 : 500GB SSD) OS : 윈도우 10 64bit, wsl ubuntu 18.04 테스트 환경은 hp 노트북이나 일반적인 x86
engpro.tistory.com
'IT > 삽질' 카테고리의 다른 글
[JAVA배포] JAR파일 vs WAR파일 (0) 2024.06.16 [WSL] putty 로 wsl 접속하기 (0) 2024.03.20 [WIN10] WSL 에 FTP 서버 구성하기 (0) 2024.03.19 [MacBook] VMware 삭제(uninstall) 하기 (0) 2024.03.08 [filezilla] root 계정으로 ftp 접속하기 (3) 2024.03.04