Is there a way to force a default value for a parameter in TeamCity and not lose it after setting a different value?

I have a parameter for which I am showing a hint. I set the default value for it and it works fine.
However, that doesn’t work, if I want to enter a different value at the start of the assembly, then the next time the assembly is made, this value will automatically become the new default, so to speak.

I want the default value to always be fixed, and if you enter a different value in the field, then this value will be used only for this assembly (and the next assembly will fall off the fixed default value for this parameter).

Is this possible and how can this be done?

+4
source share
2 answers

This is currently not possible. Related request https://youtrack.jetbrains.com/issue/TW-21453 , please vote. At the moment, you can use the "Reset" link.

+3
source

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

To solve your problem, you can use the Running Command (or Powershell) Build Runner, which starts as the last build step. 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 desiredDefaultValueinstead of a hard-coded value.

+1
source

Source: https://habr.com/ru/post/1617048/


All Articles