環境情報
# cat /etc/redhat-release
Fedora release 35 (Thirty Five)
インストールの方法
1.システムパッケージをアップデートします
# sudo dnf -y update
2.Javaをインストールします
インストール可能Javaバージョンを確認します
# sudo dnf whatprovides java
java-11-openjdk-1:11.0.12.0.7-4.fc35.x86_64 : OpenJDK 11 Runtime Environment
提供する : java = 1:11.0.12.0.7-4.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.i686 : OpenJDK 11 Runtime Environment
提供する : java = 1:11.0.13.0.8-2.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.x86_64 : OpenJDK 11 Runtime Environment
提供する : java = 1:11.0.13.0.8-2.fc35
# sudo dnf whatprovides java
java-11-openjdk-1:11.0.12.0.7-4.fc35.x86_64 : OpenJDK 11 Runtime Environment
Repo : fedora
一致:
提供する : java = 1:11.0.12.0.7-4.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.i686 : OpenJDK 11 Runtime Environment
Repo : updates
一致:
提供する : java = 1:11.0.13.0.8-2.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.x86_64 : OpenJDK 11 Runtime Environment
Repo : updates
一致:
提供する : java = 1:11.0.13.0.8-2.fc35
# sudo dnf whatprovides java
java-11-openjdk-1:11.0.12.0.7-4.fc35.x86_64 : OpenJDK 11 Runtime Environment
Repo : fedora
一致:
提供する : java = 1:11.0.12.0.7-4.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.i686 : OpenJDK 11 Runtime Environment
Repo : updates
一致:
提供する : java = 1:11.0.13.0.8-2.fc35
java-11-openjdk-1:11.0.13.0.8-2.fc35.x86_64 : OpenJDK 11 Runtime Environment
Repo : updates
一致:
提供する : java = 1:11.0.13.0.8-2.fc35
Java11をインストールします
# sudo dnf install java-11-openjdk
# sudo dnf install java-11-openjdk
# sudo dnf install java-11-openjdk
javaバージョンを確認します
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
# java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
# java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
3.jenkinsリポジトリを追加します
リポジトリファイルをダウンロードします
# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
公開鍵をインポートします
# sudo rpm –import https://pkg.jenkins.io/redhat/jenkins.io.key
リポジトリリスト一覧を確認します
# dnf repolist
repo id repo の名前
略
jenkins Jenkins
# dnf repolist
repo id repo の名前
略
jenkins Jenkins
4.jenkinsをインストールします
# sudo dnf install jenkins
5.jenkinsを起動します
# /etc/init.d/jenkins start
Starting jenkins (via systemctl): [ OK ]
# /etc/init.d/jenkins start
Starting jenkins (via systemctl): [ OK ]
# /etc/init.d/jenkins start
Starting jenkins (via systemctl): [ OK ]
ステータスを確認します
# sudo systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; generated)
Active: active (running) since Mon 2021-12-13 15:42:29 JST; 5min ago
# sudo systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; generated)
Active: active (running) since Mon 2021-12-13 15:42:29 JST; 5min ago
# sudo systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; generated)
Active: active (running) since Mon 2021-12-13 15:42:29 JST; 5min ago
jenkinsを停止します
# sudo systemctl stop jenkins
jenkinsを起動します
# sudo systemctl start jenkins
6.firewalldを有効にします
# firewall-cmd --add-port=8080/tcp --permanent
ポート8080を開放しあす
# firewall-cmd --add-port=8080/tcp --permanent
success
# firewall-cmd --reload
success
ポート8080を開放しあす
# firewall-cmd --add-port=8080/tcp --permanent
success
# firewall-cmd --reload
success
ファイアウォールのポート一覧を確認します
# firewall-cmd --list-all
services: cockpit dhcpv6-client ssh
# firewall-cmd --list-all
FedoraServer (active)
target: default
icmp-block-inversion: no
interfaces: ens160
sources:
services: cockpit dhcpv6-client ssh
ports: 8080/tcp
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
# firewall-cmd --list-all
FedoraServer (active)
target: default
icmp-block-inversion: no
interfaces: ens160
sources:
services: cockpit dhcpv6-client ssh
ports: 8080/tcp
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
7.Jenkinを起動します
http://IPアドレス:8080/でブラウザからアクセスします
操作例
http://192.168.229.129:8080/login?from=%2F
パスワードを確認します
# cat /var/lib/jenkins/secrets/initialAdminPassword
0de6dffff1ef406299b50898e65d024a
「Administartor pasword」にパスワードを入力し、「Contiunue」を押下します