目的為在公司的測試環境當中一旦開發向gitlab倉庫提交成功代碼,gitlab通知jenkins進行構建項目
一)jenkins相關配置
1.1、安裝插件
系統管理-管理插件-可選插件 Gitlab Hook Plugin和Build Authorization Token Root Plugin

1.2 生成隨機token
[www@jenkins .ssh]$ sudo openssl rand -hex 16
sudo: timestamp too far in the future: Jan 2 19:32:54 2018
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for www:
3148b091f116d1a14e15aa2d0cf2f156
1.3、配置jenkins
創建項目觸發器

二)gitlab配置
2.1:在git項目配置界面設置鏈接和token

2.2)測試
[root@static yyg]# echo "this is b.html" > b.html
[root@static yyg]# git add .
[root@static yyg]# git commit -m "add b.html"
[master 66f0c74] add b.html
1 file changed, 1 insertion(+)
create mode 100644 b.html
[root@static yyg]# git push origin master
然后查看jenkins

- 第一章:Jenkins的基本介紹
- 第二章:Jenkins服務器安裝
- 第一節:在Centos6.8系統上安裝Jenkins服務器
- 第三章:Jenkins服務器配置
- 第一節:jenkins更換初始登錄密碼
- 第二節:全局工具配置
- 第三節:安裝插件
- 第四節:jenkins中配置git
- 第五節:jenkins中配置Publish Over SSH
- 第六節:jenkins郵件配置
- 第七節:Jenkins進階-獲取git tags代碼
- 第八節:Jenkins權限配置錯誤,導致無法登錄
- 第九節: jenkins通過釘釘發送消息
- 第四章:使用 Sonar 進行代碼質量管理
- 第一節:sonar概述
- 第二節:Sonar的安裝
- 第三節:sonar安裝插件
- 第四節:sonar報錯
- 第五節:代碼分析
- 第五章: 持續集成
- 第一節:GitLab觸發jenkins構建項目
- 第六章:jenkins 2.0 pipeline 從入門到精通
- 第一節:jenkins2 hello pipeline
- 第二節:jenkins pipeline基本概念
- 第七章:jenkins部署實戰
- 第一節:jenkins部署php代碼(一)
- 第二節:jenkins部署java代碼(一)
- 第三節:jenkins部署java代碼(pom.xml)二
- 第四節:jenkins部署php代碼(根據tags)
- 第五節:jenkins部署android代碼
- 第八章:jenkins項目構建配置
- 第一節: jenkins參數化構建過程