Jenkins + gitlab 集成 實現自動構建

Jenkins + gitlab 集成後,實現的功能是 開發寫好代碼提交至 gitlab 上,當開始 push 到 gitlab 上以後,jenkins 自動幫咱們當即構建 git

1、安裝 gitlab 鉤子腳本

注意:jenkins 不論想實現什麼功能,都須要安裝插件!!
依次點擊:系統管理==>>插件管理==>>可選插件
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
一、配置鉤子腳本觸發器
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
至此觸發器就配置完了web

二、回到gitlab界面配置
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
Jenkins + gitlab 集成 實現自動構建
下來咱們回到gitlab端上傳代碼進行測試ide

[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 集成 實現自動構建gitlab

相關文章
相關標籤/搜索