如何通过API在Gitlab中更改镜像设置

如何通过API在Gitlab中更改镜像设置

本文介绍了如何通过API在Gitlab中更改镜像设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为每个存储库更改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?

备注:这与镜像设置.

推荐答案

https://docs.gitlab.com/ee/api/projects.html#edit-project ,有几个参数可以配置拉镜像:

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

有关尚未实现推送镜像的通知: 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中更改镜像设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 00:51