一、安装

前提:需查看是否安装了JDK

1.第一种方法

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key

yum install jenkins

2.第二种方法(本文使用)

wget http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.7.3-1.1.noarch.rpm

rpm -ivh jenkins-2.7.3-1.1.noarch.rpm

Centos7.x 安装jenkins_重启

3.配置jenkins端口

vim /etc/sysconfig/jenkins

找到修改端口号 JENKINS_PORT="8080"  不冲突可以不做修改

Centos7.x 安装jenkins_端口号_02

 4.配置权限

vim /etc/sysconfig/jenkins

找到修改端口号 JENKINS_USER="jenkins"  改为root

Centos7.x 安装jenkins_安装插件_03

 5.修改目录权限

chown -R root:root /var/lib/jenkins

chown -R root:root /var/cache/jenkins

chown -R root:root /var/log/jenkins

 6.重启

service jenkins restart

ps -ef | grep jenkins

7.启动

systemctl start jenkins

 

二、访问

1.访问jenkins地址 http:<ip或者域名>:8080

Centos7.x 安装jenkins_vim_04

2.查看密码

cat /var/lib/jenkins/secrets/initialAdminPassword

Centos7.x 安装jenkins_端口号_05

 3.安装插件

Centos7.x 安装jenkins_安装插件_06

Centos7.x 安装jenkins_重启_07

Centos7.x 安装jenkins_vim_08

 Centos7.x 安装jenkins_端口号_09

 

to  be continued......