Ubuntu 22.04にJenkinsをインストールする

環境
OSバージョンを確認します

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

操作方法
1.javaをインストールします

# sudo apt -y install openjdk-11-jdk

javaバージョンを確認します

# java --version
openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

2.Jenkinsリポジトリを追加します

# curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | tee /usr/share/keyrings/jenkins-keyring.asc
# echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | tee /etc/apt/sources.list.d/jenkins.list

3.システムパッケージを更新します

# sudo apt update

4.Jenkinsをインストールします

# apt -y install jenkins

5.jenkinsの起動と自動起動を有効にします

# sudo systemctl start jenkins
# sudo systemctl enable jenkins

6.Jenkinsステータスを確認します

# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-10-20 22:37:28 JST; 2min 2s ago

 

Ubuntu 22.04

Posted by arkgame