如何限制Gitlab中的维护者角色以仅部署到Prod [英] How can I restrict Maintainer Role in Gitlab to deploy only to Prod

查看:51
本文介绍了如何限制Gitlab中的维护者角色以仅部署到Prod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Gitlab中的维护者角色能够部署到创建的所有环境(例如Prod,Stage和Dev).

是否有一种方法可以限制维护者仅部署到Prod.环境

解决方案

由于维护者是项目级别最高的角色,因此不可能将其限制在产品中进行部署.您需要从相反的角度解决问题:限制开发人员角色在产品中进行部署.

使用环境时,可以使用

然后,限制具有维护者角色的用户数量.

By default Maintainer Role in Gitlab able to deploy to all environments created ( example Prod, Stage and Dev).

Is there a way to restrict Maintainer to deploy only to Prod. environment

解决方案

As Maintainer is the highest project-level role, that's not possible to restrict it to deploy in prod. You need to solve the problem thinking the opposite : restrict the developers role to deploy in prod.

As you are using environments, it's possible using Protected Environments feature (available for Premium/Silver subscription) :

  1. Navigate to your project’s Settings > CI/CD
  2. Expand the Protected Environments section
  3. In your case, select Prod as environment and Maintainer

Then, restrict the number of users having Maintainer role.

这篇关于如何限制Gitlab中的维护者角色以仅部署到Prod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆