Jenkins

Jenkins 설치하기 (Ubuntu)

thxxyj 2022. 10. 11. 09:38
728x90

0. sudo apt udate

 

1. Jenkins repository key 다운로드

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key |sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg

 

2. sources.list에 추가하기

sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

 

3. Jenkins / Java 설치하기

sudo apt update

sudo apt install jenkins

sudo apt install openjdk-8-jdk   (원하는 버전으로 설치가능)

 

4. 정상적으로 설치되었다면,  Jenkins restart 

sudo systemctl start jenkins.service

* jenkins status 확인 : sudo systemctl status jenkins

 

5. 방화벽 open하기
sudo ufw allow ${PORT_NUM} 

   * 방화벽 inactive 상태일때

      sudo ufw allow OpenSSH
      sudo ufw enable

   * 적용된 방화벽 규칙 확인하기

      sudo ufw status

 

* Jenkins HTTP_PORT 변경하기 (default 8080)

# vi /etc/default/jenkins
HTTP_PORT=${NEW_PORT_NUM} 

 

+ Jenkins v2.335 이후

# vi /lib/systemd/system/jenkins.service

Environment="JENKINS_PORT=${NEW_PORT_NUM}"

(참고: https://www.jenkins.io/doc/book/installing/linux/#debianubuntu)

 

6. sudo service jenkins restart

 

728x90