如何限制Gitlab中的维护者角色以仅部署到Prod [英] How can I restrict Maintainer Role in Gitlab to deploy only to 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) :
- Navigate to your project’s Settings > CI/CD
- Expand the Protected Environments section
- In your case, select
Prod
as environment andMaintainer
Then, restrict the number of users having Maintainer role.
这篇关于如何限制Gitlab中的维护者角色以仅部署到Prod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!