1.jenkins安装
#安装Java
[root@jenkins ~]# yum install java-1.8.0-openjdk* -y
#第一种方式:官方下载(因网络问题推荐第二种)
# 下载镜像源
[root@jenkins ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
# 安装认证Key
[root@jenkins ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
# 安装JenKins
[root@jenkins ~]# yum install jenkins
#第二种方式: 清华大学镜像站 https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/
[root@jenkins ~]# wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/jenkins-2.302-1.1.noarch.rpm --no-check-certificate
[root@jenkins ~]# yum install jenkins-2.302-1.1.noarch.rpm
#启动
[root@jenkins ~]# systemctl start jenkins
#浏览器访问10.0.0.92:8080
2.安装插件
#解压
[root@jenkins ~]# cd /var/lib/jenkins/plugins
[root@jenkins /var/lib/jenkins/plugins]# tar xf plugins.tar.gz
#重启jenkins
[root@jenkins /var/lib/jenkins/plugins]# systemctl restart jenkins.service
#浏览器刷新
3.jenkins优化插件
[root@jenkins ~]# cd /var/lib/jenkins/updates/
[root@jenkins /var/lib/jenkins/updates]# sed -i 's/https:\/\/updates.jenkins.io\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json
[root@jenkins /var/lib/jenkins/updates]# sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
#插件管理点击高级,把站点升级改为国内插件下载地址:
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json