CentOS安装Jenkins

Jenkins 是一款非常强大的持续集成工具

Jenkins需要安装 Java8 or Java11

安装 Java8

1
2
sudo yum install -y java-1.8.0-openjdk-devel
java -version

安装 Jenkins

To use this repository, run the following command:

1
2
3
4
5
6
sudo yum upgrade
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install epel-release # repository that provides 'daemonize'
# yum install java-11-openjdk-devel
sudo yum install jenkins

If you’ve previously imported the key from Jenkins, the rpm --import will fail because you already have a key. Please
ignore that and move on.

The rpm packages were signed using this key:

1
2
3
4
pub   rsa4096 2020-03-30 [SC] [expires: 2023-03-30]
62A9756BFD780C377CF24BA8FCEF32E745F2C3D5
uid Jenkins Project
sub rsa4096 2020-03-30 [E] [expires: 2023-03-30]

下载安装

GitHub地址

1
rpm -ivh jenkins-2.327-1.1.noarch.rpm

启动

1
2
3
4
sudo systemctl start jenkins
sudo systemctl status jenkins
sudo systemctl enable jenkins
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

访问

http://192.168.2.250:8080

输入 initialAdminPassword 文件中的密码

配置中文

插件管理中安装 locale插件。

系统管理配置中找到 Default Language = zh_CN

参考官网

官网 doc book install linux

本文地址: https://github.com/maxzhao-it/blog/post/e1cf5d/