在CI/CD配置文件设置中自动添加.gitlab-ci.yml文件

发布于 2025-01-20 15:03:31 字数 310 浏览 6 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹雨成花 2025-01-27 15:03:31

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.


  1. 另一种选择是配置A noreflow noreferrer“ GraphQL API将该框架分配给项目。

I think there are 3 possibilities to enforece a common/shared CI config file:

  1. Edit Project API and set the ci_config_path value.

  2. 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.


  1. Another alternative is to configure a compliance framework and use the GraphQL API to assign that framework to projects.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文