Kotlin DSL, build parameters

Hi,

How to use build parameters in Kotlin script (settings.kts)?

I found a documentation describing parameters (https://confluence.jetbrains.com/display/TCD18/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties) but I don't understand how to reference them in build steps.

I've tried echo %teamcity.build.branch% in powershell script and it worked, but the statement below dont:

var branchName = "%teamcity.build.branch%"

0
1 comment

Hi Ilya,

 

Using the Kotlin DSL for this task should be irrelevant. If you access the Web UI after the changes from the DSL have been pulled, you should find exactly the same (%teamcity.build.branch% in both cases).

 

This said, it will work if you write the script as a script in the web UI. If you have the parameter reference within a script file, it will not work, as we cannot preprocess the file to replace the parameters.

0

Please sign in to leave a comment.