质量门禁:Verigreen开启Git的Commit门禁

{"type":"doc","content":[{"type":"heading","attrs":{"align":null,"level":1}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Verigreen 是一个轻量级的Git的checkin的门禁,通过Verigreen可以保护代码分支不受污染。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Verigreen看好质量门禁的大门"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在很多情况下,RD提交了他的代码后就会触发CI的流程,当CI的后面会跟着CD进程。但是如果在这个过程中最开始提交的代码就有一些问题,如果CI/CD过程没有门禁卡点,代码仓库的主干代码就被污染了。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果有Verigreen,那么当RD提交代码给对应的分支的时候,提交的代码如果没有经历任何验证是无法成功提交到代码仓库中的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/fb/fb7f3fb605c99e1cc4cf0eb15d612437.png","alt":"在这里插入图片描述","title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Verigreen flow"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在我们提交代码到git仓库的时候,有很多优秀的模式,例如GitFlow模式等,那么我们权且把使用Verigreen的模式叫做Verigreen Flow吧。那么VerigeenFlow模式是如下工作的:"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/da/da00e4066dddf30fb8f8ad00151b938e.png","alt":"在这里插入图片描述","title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1 RD将改动的代码push到远端分支"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2 代码变更出发了Verigeen"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"3 Verigeen检查这次commit的代码的目标分支是不是被保护分支,如果不是被保护分支,那么就会正常的将其合并到对应的branch里面。如果是被保护的分支,那么Verigeen会将将代码commit到一个临时的分支中,然后针对这个临时分支运行验证程序。"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"4 Verigeen如果验证失败,他会将失败的结果推送给流程发起端,如果验证成功,那么合并提交,然后将丢弃(删除)临时分支,然后过程结束。 如果不是,则更改被拒绝并保留在临时分支上,变更发起人会收到对应状态的email。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"感兴趣的通过可以去Github尝试一下,项目中提供了docker镜像可以快速启动验证功能。https://github.com/Verigreen/demo"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章