typed build parameters

Hi,

So I wanted to use the build type parameters to do one of the following:

  • Use the password option and have the user type in a password that teamcity will validate and only run the build if it is matched
  • Use the text field and have the user enter the version number they want to deploy and match it against the actual build number used and teamcity should fail if it is the wrong build number


All of these options would use the prompt feature but basically we have a build chain using snapshots and a user triggers a deployment build using one of the options above.  Using the type parameter feature I couldn't seem to get any of these working since it required a value in order to save it which kind of defeated the purpose since I don't want a default and I want the user to enter something but having to enter in a value that matches the regex for the text field approach.  Can someone from jetbrains suggest an approach?

Thanks,
Jay

1 comment
Comment actions Permalink

Hi Jason

The usual approach for such kind of tasks in TeamCity is to organize deployment configurations into separate project, and use project-level permissions. Specific artifacts can be promoted to dependent build configurations from Build Actions menu.

But answering your questions directly: The typed parameter can be declared as mandatory by Display:Prompt option. But all the validation for valid/invalid passwords and build numbers should be placed inside your build script. You can fail the build if they do not match, but cannot prevent its launch.

Maybe the better solution for this task would be an external UI, that's connected with TeamCity by Open or REST API.

Michael

0

Please sign in to leave a comment.