centos7.2 yum 安装jenkins

1、首先安装好Java

yum install -y java
java -version

2. 获取jenkins安装源文件   

  wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo

3. 导入公钥 (如果报错,多执行几次就好了) 

yum -y update nss
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

 4. 安装Jenkins

yum install -y jenkins 

5. 配置文件修改( 修改默认端口为8787)

 vim  /etc/sysconfig/jenkins

 6.启动

 service jenkins start

报错解决

yum -y install java-1.8.0-openjdk.x86_64 

 

7.访问安装 http://{IP地址}:8787

 8、加入开机自启动

systemctl enable jenkins.service



        

原文地址:https://www.cnblogs.com/wangyong-blog/p/9707715.html