[Kotlin] Is it possible to read a master node identifier during compilation?


Hi there!

we've recently upgraded our build configurations to use Kotlin. We are currently running two TeamCity master instances - one production and one staging. They both run the same configuration. We currently have the use case of wanting to be able to enable a build feature on production and disable it on staging. It is not possible to disable the plugin globally on the staging instance because that breaks the Kotlin compilation process.

Is there currently any way to get a unique identifier of the instance that is compiling the Kotlin config during compilation?
Would you have any alternative suggestions for our use case?


1 comment
Comment actions Permalink

Hi Philipp,


for this use case we recently introduced this feature: https://www.jetbrains.com/help/teamcity/kotlin-dsl.html#KotlinDSL-UsingContextParametersinDSL . While it's described and used for separate projects, the same applies for separate servers (you just pass the different parameters in the different servers). It was introduced in 2019.2


Would that work for you?


Please sign in to leave a comment.