如何通过API在Gitlab中更改镜像设置? [英] How can I change the mirroring settings in Gitlab over the API?
问题描述
我想为每个存储库更改Gitlab镜像设置.是否可以通过Gitlab API做到这一点?
I want to change the Gitlab mirroring settings for each of my repositories. Is it possible to do this over the Gitlab API?
Gitlab WebUi允许的选项如下:
The options the Gitlab WebUi allows, are the following:
如何通过API更改它们?
How can I change them via the API?
备注:这与镜像设置.
推荐答案
On https://docs.gitlab.com/ee/api/projects.html#edit-project there are several parameters to configure the pull mirroring:
> mirror
> mirror_user_id
> mirror_trigger_builds
> only_mirror_protected_branches
> mirror_overwrites_diverged_branches
注意:如果您的HTTP存储库不可公开访问,请添加 URL的身份验证信息:
https://用户名:password@gitlab.company.com/group/project. git 其中 密码是启用了api范围的公共访问密钥
Note: If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git where password is a public access key with the api scope enabled
有关尚未实现推送镜像的通知: https://gitlab.com/gitlab-org/gitlab-ee/issues/7599
Notice that Push mirroring is not yet implemented: https://gitlab.com/gitlab-org/gitlab-ee/issues/7599
这篇关于如何通过API在Gitlab中更改镜像设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!