Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity :User must pass parmeters to build

Everytime a user executes a run on TeamCity, I want the TeamCity to prompt the user to enter certain parameters to be passed similiar to a custom run and if parameters are not passed, the build doesn't execute.

I understand custom run will allow this parameter passing but I want the parameter supplied condition to be met first before execution on a normal run, is this possible?

like image 973
user983965 Avatar asked Dec 26 '22 13:12

user983965


1 Answers

EDIT: It appears that you can have prompted parameters in TeamCity 7.x by using 'Typed build parameters': What's new in TeamCity 7.0 - Typed build parameters - have a look at the 'display type' options.

Although the terminology they use is that the parameters 'require a review' which suggests it doesn't force them to actually enter something, so perhaps this combined with the approach described below would be required for your scenario (i.e the user has to enter the correct parameters)

For TeamCity 6.5, I faced this problem a while back myself, and wasn't able to find a solution to prompt for the parameters. The normal run would just kick off as soon as 'Run' was clicked.

However, one thing that I did do was to include an upfront build step with a small batch script that would return an error if the necessary parameter(s) hadn't been supplied. This way at least I could ensure that the builds only ran (well, only ran succesfully) if the parameters were provided via the 'Run Custom' option.

Nonetheless, anyone trying to run the build had to know this, and had to know to select the 'Run Custom' option and provide the parameters to be able to get a green build.

like image 192
Chamila Chulatunga Avatar answered Dec 31 '22 11:12

Chamila Chulatunga