Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to lock "Run" button in TeamCity

Tags:

teamcity

I made a build in TeamCity which deploys code to live server. As a precaution I want to disable that button "run" can be clicked by mistake.So I want to have an additional level of checking "whether I'm sure" I want to click "run" button. Is it possible to accomplish? Thanks in advance!

like image 745
babazumbula Avatar asked Mar 25 '11 14:03

babazumbula


People also ask

How to grant Admin access on 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.

How do I archive a project on TeamCity?

If a project is not in an active development state, you can archive it using the Actions menu in the upper right corner of the Project Settings page. On the Archive project screen, you can choose whether to cancel the builds which are already in the queue using the corresponding option (enabled by default).


2 Answers

I don't think there is a way to disable the run button.

An approach I've used is to have a Property which gets passed to the build script which needs to be true for the script to run, it's false or not set then the build script throws an error. Then in the build configuration on the Properties & Environment Variables page I set the property to false. Now whenever I need to run the script I have to use the "Run custom build" button (the "| ..." bit beside the run button), then I set the value to true before hitting the build button.

like image 127
JMason Avatar answered Feb 07 '23 03:02

JMason


Another, easier option, is to add a agent requirement to your build such that only the production server's agent can meet it (e.g. env.COMPUTERNAME equals MyProductionServer01), and then disable the agent with a note about "locking" the production build. This will prevent the build from actually running if you accidentally click the Run button.

like image 39
jslatts Avatar answered Feb 07 '23 04:02

jslatts