一、准备工作:
# 习惯性的创建归档目录
mkdir -p /usr/local/app
# 将jdk和tomcat解压到此目录后继续配置环境变量
vi ~/.bash_profile
# java environment
export JAVA_HOME=/usr/local/app/jdk1.8.0_241
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
# jenkins.war放入到tomcat的webapps目录下
二、经过多次尝试,jenkins插件安装缓慢,所以提前配置好镜像:
# 替换升级目标地址,浏览器打开:http://192.168.1.194:8080/jenkins/pluginManager/advanced
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
# 替换default.json内容
cd /root/.jenkins/updates
sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json
# 如果已经启动,请重启服务
http://192.168.1.194:8080/jenkins/restart