Use the TeamCity as a CD tool
Answered
Is there a way to inject passwords during build to app config files?
Requirenets:
- X config files with Y placeholders to be replaced during build
- sensitive information (passwords) must be stored as "password" configuration parameter (not visible)
- amount and names of parameters to replace is unknown (dynamic)
Please sign in to leave a comment.
Hi! Currently, TeamCity doesn't allow to set the parameter type to password in the build runtime, but this feature request should cover that use case: https://youtrack.jetbrains.com/issue/TW-74906.
In the meantime, it should be technically possible to achieve something like that, although the workaround would be a bit hacky. You can create an auxiliary build configuration that would 1) calculate the number of parameters and their names,
and 2) edit the main build configuration by adding the parameters of the 'password' type (related topic: editing build configurations via REST API). Run the auxiliary configuration each time before running the main configuration (e.g. using a snapshot dependency).