动态更新Gitlab CI判决
我已在 CI .yaml 文件中编写此代码,以对警告数量进行硬限制。基本上,我创建了一个警告数量的变量,并与它进行比较。 现在的问题:我希望当有人减少警告数量时。 CI 将 YAML 文件中的变量更新为较小的值并将其合并。
这可以通过 git lab CI 或合并列车来完成吗?也许可以让 CI 更新 .YAML 文件并将其与更改合并?或者可能有一种方法可以在 CI 之间共享变量并从 CI 更新它?
我的代码:
variables:
WARNING_LIMIT: 326
………………….....////// Some code
- exit_code=0; make -j 8 xyz -C build 2>&1 | tee build_output.txt || exit_code=1
- if [ `grep “error:” build_output.txt | wc -l` -ne 0 ] ; then exit_code=2 ; fi;
- if [ `grep “warning:” build_output.txt | wc -l` -gt $WARNING_LIMIT ] ; then exit_code=3 ;fi;
- if [ $exit_code -eq 3 ]; then echo “Make command target warning limit exceeded”; fi;
I’ve written this code in my CI .yaml file to put a hard limit for number of warnings. basically I created a varaible for number of warnings and I compare to it.
The problem now : I want That when someone decreases the number of warnings. the CI updates the variable in the YAML file to the lesser value and merge it.
Is this possible to be done via git lab CI or the merge train ? May be It is possible to make the CI update the .YAML file and merge it with the changes ? or may be there is a way to share a variable across the CIs and update it from the CI ?
My code:
variables:
WARNING_LIMIT: 326
………………….....////// Some code
- exit_code=0; make -j 8 xyz -C build 2>&1 | tee build_output.txt || exit_code=1
- if [ `grep “error:” build_output.txt | wc -l` -ne 0 ] ; then exit_code=2 ; fi;
- if [ `grep “warning:” build_output.txt | wc -l` -gt $WARNING_LIMIT ] ; then exit_code=3 ;fi;
- if [ $exit_code -eq 3 ]; then echo “Make command target warning limit exceeded”; fi;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论