Jenkins的搭建
在这里,我们只讲怎么搭建
1: 首先要用一台linux的服务器
2: 安装的有jdk,并配置过jdk的环境变量
1、安装jdk
我安装的是jdk8,此处就不多说了,自己百度哈,很简单
2、安装jenkins
首先依次执行如下三个命令:
2.1、导入镜像:
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
2.2、导入公钥
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
2.3、安装jenkins:
yum install jenkins
2.4、修改配置文件
vi /etc/sysconfig/jenkins
修改这部分:
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8091"//修改这部分
## Type: string
## Default: ""
## ServiceRestart: jenkins
2.5、启动jenkins
[root@VM_0_13_centos local]# systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
2.6、查看jenkins的启动状态
[root@VM_0_13_centos local]# systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[root@VM_0_13_centos local]# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: failed