添加yum源
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
安装java-8.0
yum install java -y
java -version
关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
vim /etc/selinux/conf
SELINUX=disabled
jenkins安装
yum install jenkins
创建jenkins系统用户
useradd deploy
更改jenkins启动用户和端口
vim /etc/sysconfig/jenkins
jenkins_user=deploy
jenkins_port=8080
更改相关目录属主
chown -R deploy:deploy /var/log/jenkins/
chown -R deploy:deploy /var/lib/jenkins/
chown -R deploy:deploy /var/cache/jenkins/
启动jenkins
systemctl start jenkins
访问web页面初始化