centos7机器
1.服务器下载jenkins包并安装
yum -y install java-1.11.0-openjdk
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
systemctl daemon-reload
systemctl start jenkins
systemctl enable jenkins
2.登录安装
http://192.168.106.129:8080/
密码从/var/log/messages上获取得到
默认会出现离线安装
1)到服务器上找到/var/lib/jenkins/updates下的default.json,执行如下命令
sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
sed -i 's/https:\/\/updates.jenkins.io\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json
2)打开另一个浏览器新窗口,http://192.168.106.129:8080/pluginManager/advanced
3)重启服务器端jenkins就可以正常获取了
参考:https://juejin.cn/post/7144989607757611045
非常坑:一定不要自行安装插件,到时候会有很多功能不适应,jenkins不适合安装旧版本,会出现各种插件安装不上