centos 7 安装Jenkins
[root@hejianlai-jenkins web-demo]# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@hejianlai-jenkins web-demo]# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@hejianlai-jenkins web-demo]# yum install java jenkins –y
#JenKins默认端口为8080,因为gitlab已经占用我们需要更改。
[root@hejianlai-jenkins web-demo]# vim /etc/sysconfig/jenkins
JENKINS_PORT="8080" ---> JENKINS_PORT="8081"
#启动JenKins
[root@hejianlai-jenkins web-demo]# /etc/init.d/jenkins start
Starting jenkins (via systemctl): [ OK ]
#浏览器登录JenKins,地址:http://192.168.247.135:8081/
正在启动;

进入有个密码路径,系统上查看这个文件并把密码复制粘贴才能登录;


选择推荐安装;

创建一个管理员

开始使用jenkins

下面实现持续集成
进入主页--创建一个新任务

输入项目名称---构建一个自由风格的软件项目---确认

General--填写项目描述

源码管理--安装git插件--授权认证

ssh私钥认证我们在系统上查看粘贴进去即可。


Credentials—选择root

查看gitlab版本
[root@hejianlai-jenkins ~]# rpm -aq|grep gitlab
gitlab-ce-10.6.0-ce.0.el7.x86_64

点击立即构建

点击控制台输出查看

控制台输出,SUCCESS则构建成功
