首页 > 其他 > 详细

Jenkins + gitlab 集成 实现自动构建

时间:2020-03-25 16:37:35      阅读:58      评论:0      收藏:0      [点我收藏+]
Jenkins + gitlab 集成后,实现的功能是 开发写好代码提交至 gitlab 上,当开始 push 到 gitlab 上之后,jenkins 自动帮我们立即构建

一、安装 gitlab 钩子脚本

注意:jenkins 不论想实现什么功能,都需要安装插件!!
依次点击:系统管理==>>插件管理==>>可选插件
技术分享图片
技术分享图片
技术分享图片
1、配置钩子脚本触发器
技术分享图片
技术分享图片
技术分享图片
技术分享图片
至此触发器就配置完了

2、回到gitlab界面配置
技术分享图片
技术分享图片
技术分享图片
技术分享图片
技术分享图片
技术分享图片
技术分享图片
技术分享图片
下来我们回到gitlab端上传代码进行测试

[root@jenkins test1]# ls -a 
.  ..  .git  README.md  reports  src  test222.txt  tests
[root@jenkins test1]# echo "aaa" >> test2.txt
[root@jenkins test1]# git add *
[root@jenkins test1]# git commit -m "test auto"
[master 6b3cff7] test auto
 1 file changed, 1 insertion(+)
 create mode 100644 test2.txt
[root@jenkins test1]# git push origin master 

回到Jenkins的web页面可以看到已经自动构建
技术分享图片

Jenkins + gitlab 集成 实现自动构建

原文:https://blog.51cto.com/14227204/2481646

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!