How to fetch the Value of Teamcity Configuration in java?

1.4k views Asked by At

I have a piece of java code where I have to display the Teamcity build configuration name. This piece of code will be executed in one of the steps configured for the configuration.

can we read value of the env variable %env.TEAMCITY_BUILDCONF_NAME% set in Teamcity configuration settings and use or is there anyother way of o fetching the Value of Teamcity Configuration Name?

1

There are 1 answers

1
Sam Holder On BEST ANSWER

yes, you just need to read the environment variable value in the code.

This should get what you need:

final String buildConfigName = System.getenv("TEAMCITY_BUILDCONF_NAME");