parautenbach / TeamCity-HipChat-Notifier

TeamCity HipChat Notifier for sending build server notifications to HipChat.
Other
59 stars 31 forks source link

Exposing build paramters #16

Closed cmluciano closed 10 years ago

cmluciano commented 10 years ago

Is it possible to grab build parameters and display them in a custom field? A use case for this would be displaying the servername that something was deployed to. I tried just placing this in box grabbed for build number but this breaks build chain functionality.

parautenbach commented 10 years ago

That is an interesting suggestion, thank you. I've started work on allowing customisation of message templates. I'll look into exposing build parameters to these templates.

parautenbach commented 10 years ago

This feature is now available in the latest release.

As an example, build and agent parameters can be accessed as follows, assuming all parameters are valid (the first three needs to be added to the build configuration):

conf param: ${.data_model["conf_param"]}<br>
sys param: ${.data_model["system.sys_param"]}<br>
env param: ${.data_model["env.env_param"]}<br>
TC version: ${.data_model["system.teamcity.version"]}<br>
Agent dir: ${.data_model["system.agent.home.dir"]}<br>
Java home: ${.data_model["env.JAVA_HOME"]}<br>
Agent name: ${.data_model["system.agent.name"]}

Templates are defined using the FreeMarker syntax.