is it possible to read values from a file and write to a parameter with the type - "select"

Answered

Hello everyone.

Help me please.

  There is a Sonatype Nexus. It contains a repository with artifacts. Artifacts in my case is an updated application. There is TeamCity 2019.2.2. In it, one of the assemblies updates the application on one of the servers.

  At the moment, when starting the assembly, I am prompted, in which the user manually specifies the version of the application that needs to be downloaded from the Nexus.

  I want to simplify this procedure for the user. To do this, I extract information from the Nexus about the available versions and I need to pass the resulting information to the TeamCity parameter so that when the assembly starts, a query is displayed with the ability to select the required version (in fact, a parameter with the type - "select").

  Please tell me, is it possible, for example, to read values ​​from a file and write to a parameter? Or maybe there are other options?

0
4 comments
Avatar
Fedor Rumyantsev

Hello!

Unfortunately, no, dynamic values for a "select"-typed parameter are not supported right now. There is a related feature request - https://youtrack.jetbrains.com/issue/TW-50619 - and I have added an internal reference there to this thread. 

As of now, I see two possible workarounds:

1) you could have a first step based on a command-line script which would fetch available versions and validate the passed parameter. For example, you could have it to automatically supply latest if none is passed, or fail the build if the assembly version provided does not exist. However, this obviously does not cover all cases;

2) alternatively, you could have a separate build configuration which would fetch the versions and then, via REST API, update the configuration which you use to deploy, specifically, the list of values available for the deployment. You could then execute this new configuration before invoking deployment one, so that it would have the available values up-to-date.

Please let me know if you would like any details on either approach.

0
Avatar
Permanently deleted user

I'm used plugin - https://plugins.jetbrains.com/plugin/9076-web-parameters. This plugin has regularly been used to achieve pretty much this exact goal, instead of having it be read from a file, by simply requesting directly via REST to the nexus repo which versions are available and presenting those.

Thank you very much for your feedback.

0
Avatar
Fedor Rumyantsev

Hello!

Sorry, I have missed the existence of this one so I did not mention it to you as a possible option; glad to hear it works for you, though! 

0
Avatar
Permanently deleted user

Thank you very much for your help!!!!

0

Please sign in to leave a comment.