在CI/CD配置文件设置中自动添加.gitlab-ci.yml文件
我对 GitLab 完全陌生,我有一个场景,我需要自动将 .gitlab-ci.yml 文件添加到所有项目存储库,以便触发 Checkmarx 中的漏洞扫描管道。
我发现我们可以通过项目设置>手动在存储库中添加路径文件CI/CD>通用管道>CI/CD 配置文件 。
这仅适用于每个项目存储库,但在我有超过 100 个项目的情况下,是否有一种方法可以自动化并在创建项目存储库时设置 .gitlab-ci.yml 文件?
I'm completely new with GitLab and I have a scenario where I need to automatically add a .gitlab-ci.yml file to all the project repositories, in order to trigger the pipeline for vulnerability scan in Checkmarx.
I found that we can manually add a path file in a repository by going through the project settings> CI/CD> General Pipelines>CI/CD configuration file .
This is only doable per project repository, but in a scenario where I have more than 100 projects, is there a way to automate and have the .gitlab-ci.yml file set upon the creation of a project repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
I think there are 3 possibilities to enforece a common/shared CI config file:
。
In both those cases, you might need to wrap a call to the respective API a loop that iterates through all groups and subgroups first, to find all projects and their IDs, see:
Or, brute-forcely iterate up from project ID
1
to a known high ID.I think there are 3 possibilities to enforece a common/shared CI config file:
Edit Project API and set the
ci_config_path
value.Create File in Repository REST API.
In both those cases, you might need to wrap a call to the respective API a loop that iterates through all groups and subgroups first, to find all projects and their IDs, see:
Or, brute-forcely iterate up from project ID
1
to a known high ID.