1.下载依赖
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
2.导入秘钥
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3.安装
yum install jenkins
4.启动前请检查是否已安装java
java -version
5.查找jenkins安装路径
rpm -ql jenkins
6.配置jenkins
netstat -ntlp
vim /etc/sysconfig/jenkins
如有占用请修改
7.启动jenkins
java -jar /usr/lib/jenkins/jenkins.war
之后在浏览器中输入jenkins的地址(服务器的ip:设置的端口)
cat /var/lib/jenkins/secrets/initialAdminPassword
获取密码
安装插件即可使用