ZPY博客

centos安装jenkins

1、安装JDK

yum install -y java

2、安装jenkins
添加Jenkins库到yum库,Jenkins将从这里下载安装

wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
yum install -y jenkins

配置jenkis的端口
/etc/sysconfig/jenkins
找到修改端口号:
JENKINS_PORT="8080"  此端口不冲突可以不修改 

3、启动jenkins

service jenkins start/stop/restart

浏览器中输入http://localhost:12000进入jenkins
*12000是之前修改的端口号
首次进入会要求输入初始密码如下图, 
初始密码在:/var/lib/jenkins/secrets/initialAdminPassword