Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to force a default value for a parameter in TeamCity and not lose it once a different value has been set?

I have a parameter for which I'm showing a prompt. I've set a default value for it and that works fine.
What doesn't work, however, is that if I choose to enter a different value when running the build, then on the next build this value automatically becomes the new default value, so to say.

I'd like the default value to always be fixed and if you enter a different value in the field, then that value will be used just for this build (and the next build will fallback to the fixed, default value for this parameter).

Is this possible and how can it be done?

like image 383
carlspring Avatar asked Nov 23 '15 10:11

carlspring


2 Answers

Currently it's not possible. The related request is https://youtrack.jetbrains.com/issue/TW-21453, please vote. As of now you can use "Reset" link.

like image 66
Alina Mishina Avatar answered Sep 28 '22 03:09

Alina Mishina


As far as I know, there's no built-in solution for this.

To solve your problem, you could use a Command Line (or Powershell) Build Runner that runs as the last step of the build. There you can reset your parameter by setting it to the desired default value using this as script content:

##teamcity[setParameter name='your.parameter' value='desiredDefaultValue']

I would recommend using a separate parameter to save desiredDefaultValue instead of a hard-coded value.

like image 33
Mecaveli Avatar answered Sep 28 '22 02:09

Mecaveli