简述
我们采用Jekins作为系统编译工具。
环境准备
Host List
IP Address | Hosts | Disk | Comment |
---|---|---|---|
192.168.0.23 | jekins | 1TB |
OS
我们采用CentOS作为宿主机操作系统,版本请升级为最新稳定版7.6。(CentOS7即可,建议升级到最新稳定版7.6)
升级方式,请参考本人的另一篇文章:https://www.jianshu.com/p/3e3bc1f51332
并将内核升级到最新稳定版本4.20.
[root@localhost ~]# uname -sr
Linux 4.20.0-1.el7.elrepo.x86_64
[root@localhost ~]#
[root@localhost ~]#
安装步骤
下载安装Yum源
[root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
--2019-01-10 14:55:36-- https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 52.202.51.185
Connecting to pkg.jenkins.io (pkg.jenkins.io)|52.202.51.185|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85
Saving to: ‘/etc/yum.repos.d/jenkins.repo’
100%[====================================================================>] 85 --.-K/s in 0s
2019-01-10 14:55:38 (1.87 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [85/85]
[root@localhost ~]#
[root@localhost ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@localhost ~]#
Yum安装Jekins
[root@localhost ~]# yum install jenkins
修改JDK路径
修改/etc/rc.d/init.d/jenkins中的JDK路径。
[root@localhost init.d]# pwd
/etc/rc.d/init.d
[root@localhost init.d]# vi jenkins
......
candidates="
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/bin/java
......
修改Jekins启动参数
修改/etc/sysconfig/jenkins中Jekins的相关参数。
[root@localhost ~]# vi /etc/sysconfig/jenkins