gitlab连接Jenkins
创建token后 , 现在的网页上就会出现一个token:
token只出现一次,注意保存
将这个token在Jenkins上配置,现在开始配置Jenkins
Jenkins配置自动化集成上线:
配置Jenkins:
添加构建后操作:
设置完成后点击立即构建
去仓库查看:
打了 √ 这个是标准提交. 为了验证.我们在修改文件让他自动提交
[root@node1 leilei_test]# cd /leilei/leilei777/leilei_test
[root@node1 leilei_test]# echo "<h1>chenleilei _ auto 自动提交 </h1> " >>index.html
[root@node1 leilei_test]# git add index.html
[root@node1 leilei_test]# git commit -m "modify add 自动提交 index.html"
[master 31c4c67] modify add 自动提交 index.html
1 file changed, 1 insertion(+)
[root@node1 leilei_test]# git push -u origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 403 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@10.0.0.63:root/leilei_test.git
45a7388..31c4c67 master -> master
Branch master set up to track remote branch master from origin.
推送成功后,查看结果.
已经看到了 我们添加的内容了,因为没有设置网页编码 中文显示的乱码
现在可以去 gitlab上查看commit