카이도스의 Tech Blog

jenkins 설치 본문

CI CD

jenkins 설치

카이도스 2024. 2. 26. 17:01
728x90
반응형
  • jenkins 설치(Ubuntu 22.04)
# java install
sudo apt install -y openjdk-11-jdk
java -version
openjdk version "11.0.21" 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

# ubuntu 22.04 Jenkins Install
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 update && sudo apt install -y jenkins

# Volume 마운트
sudo mkdir -p /data 
sudo mount /dev/sdb1 /data
sudo chown -R ubuntu:ubuntu /data
sudo vi /etc/fstab
/dev/sdb1 /data xfs defaults 0 1

# 데이터 복사
sudo cp -av /var/lib/jenkins /data/

# jenkins Data 디렉토리 변경
sudo vi /lib/systemd/system/jenkins.service
Environment="JENKINS_HOME=/data/jenkins"
WorkingDirectory=/data/jenkins

# jenkins 데몬 실행
sudo systemctl daemon-reload
sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo systemctl status jenkins

# 브라우저에서 http://IP:8080 접속
# initial Password 확인 후 설치 진행 (INSTALL suggested plugin을 선택)
sudo cat /data/jenkins/secrets/initialAdminPassword
516daaa91ae043398dfbe936462f5829

728x90
반응형

'CI CD' 카테고리의 다른 글

Sonarqube Upgrade  (2) 2024.02.27
Sonarqube 설치  (0) 2024.02.27
Comments