Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide TeamCity configuration for selected users?

I have one TeamCity project Dac.Test that contains 3 configurations: DEV, QA, PROD.

enter image description here

Also I have some users associated with their Roles. Is this possible to hide / show certains configurations for selected users or groups?

For example: Users associated with group: Testers can see QA configuration, but not PROD and DEV.

like image 545
Dariusz Avatar asked Apr 24 '13 13:04

Dariusz


People also ask

How do I disable TeamCity build configuration?

Pausing Build Configuration To remove the builds of the paused build configuration from the build queue, check the Cancel already queued builds box. Click Pause to confirm. To activate a paused build configuration, select Activate in the Actions menu.

How do I give access to TeamCity?

Unless explicitly configured, the simple authorization mode is used in TeamCity Professional and per-project is used in TeamCity Enterprise. To change the authorization mode, go to Administration | Authentication and enable/disable the Enable per-project permissions option.

What is a build configuration in TeamCity?

Last modified: 30 October 2022. This section contains articles on how to create and configure build configurations via the TeamCity UI. A build configuration is a collection of settings used to start a build and group the sequence of the builds in the UI.

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.


2 Answers

There is no way of managing user permissions per-build, this is available on a project level only. You could create a sub-project in the Dac.Test project to cater for this

If you're looking for a way of stopping people from mistakenly running this build, the following approach will work.

This method uses a prompt box that will pop up after you click the run button, it also needs input from the user confirming that they mean to run the build. No one can run this build by accident

  1. Go to your build configuration in the TeamCity UI
  2. From here, go to Edit Configuration Settings --> Parameters --> Add new parameter
  3. Enter something like 'Confirmation' as the parameter name
  4. Then beside 'Spec:', click the 'Edit...' button
  5. Set up the parameter as shown in the following screenshot:

enter image description here

You will now be prompted and asked for confirmation when you click the run button. The user will have to enter 'YES' in the prompt box that appears, any other value will stop the user from building: enter image description here

like image 148
ShaneC Avatar answered Oct 07 '22 21:10

ShaneC


This is best accomplished by using TeamCity's built-in role management. Roles allow you to set fine-grained permissions for users and groups. One potential issue, however, is that roles are scoped to projects (not build configurations). You'll need to create a separate Dac.Test QA project+configuration and provide your Testers the necessary privileges there. You'll also need to make sure that they are stripped of all privileges for the Dac.Test project.

like image 35
John Hoerr Avatar answered Oct 07 '22 21:10

John Hoerr