环境变量
Centos: 7.8
JDK: 17.0.7
jenkins: 2.452.2
JDK安装不赘述,可以参考这篇文件Centos7安装Java17
1. 安装Jenkins
- 推荐直接yum安装,docker还要映射路径和其他权限问题,比较麻烦
yum upgrade
# 添加 Jenkins 存储库
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
# 导入 Jenkins GPG 密钥
rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
# 安装 Jenkins
yum upgrade
yum install fontconfig
yum install jenkins
- 修改Jenkins服务配置
vim /usr/lib/systemd/system/jenkins.service
# 注释放开,定义JDK路径
Environment