Replies: 8 comments
-
|
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure there's no way to make this work consistently. |
Beta Was this translation helpful? Give feedback.
-
I understand there are restrictions on integrating with any kind of CI. So setting up complex scenarios in TeamCity through scripting in Nuke has it limitations. What do you mean by |
Beta Was this translation helpful? Give feedback.
-
About passing down parameters, I just found a nice shortcut:
Like this only code needs to be modified in the generation of TeamCity configuration. For passing up parameters something similar is maybe also possible. |
Beta Was this translation helpful? Give feedback.
-
In the nearest future i have no capacity to work on this. If it's important for you, then you can sign up for a sponsorship. |
Beta Was this translation helpful? Give feedback.
-
It's totally fine that this isn't on your roadmap currently. I think I'm gonna give it a try to implement it myself and give you a pull request to have a look at. |
Beta Was this translation helpful? Give feedback.
-
Actually that includes pull requests :) |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot that you've mentioned that we can pass variables down the build chain in team city. I've tested it and it worked in team city 2024.03.2 (build 156319).
|
Beta Was this translation helpful? Give feedback.
-
Description
Build automation often requires to incorporate parameters that are dynamic as mentioned in the documentation. They can be passed via command-line arguments. This works rather well when you run such a build chain locally.
In TeamCity unfortunately it requires a lot more effort to be able to pass down/up values of dynamically assigned parameters across build configurations (BCs) and agents.
Currently, after generating the settings.kts file from a project setup with Nuke and importing it in TeamCity, this results in a build chain where the information of dynamic parameters gets lost when starting a dependent BC.
Initial investigation
Parameters defined in a nuke build project are translated to environment variables in TeamCity (e.g.
env.paramName
). In order to pass down parameter values from the root BC to its dependencies, you need to define a configuration parameter in the root BC (e.g.reverse.dep.*.env.paramName
). Any dependency BC that has an environment variable defined with codeenv.paramName
will now get the root's parameter value injected.Passing parameters up the chain requires less setup. Variables from dependency BCs can be accessed through
dep.*.env.paramName
.Suggestion
If you agree that passing parameters up en down in TeamCity should be supported as is it is now in Nuke, I believe there are two places to have a look at:
TeamCityConfigurationParameter.Write(..)
There should be two parameters installed:env.paramName
However this one isn't shown in the prompt anymore.reverse.dep.*.env.paramName
This is the one that will be shown in the prompt.ParameterService.GetParameter(..)
This section could get an additional block of logic only to be executed in case of TeamCity.dep.*.env.paramName
reverse.dep.*.env.paramName
env.paramName
Beta Was this translation helpful? Give feedback.
All reactions