I use two build configurations.
The buildfile for 'Sub' requires a environment parameter 'Param' to run. Can I pass this parameter from my 'Root' configuration to the 'Sub' configuration in Teamcity.
In the build number pattern or VCS labeling pattern, you can use the %<prefix>. parameter_name% syntax to reference any parameter known by TeamCity: Predefined parameters of a server or build configuration. Custom build parameters added on the Build Configuration Settings | Parameters page.
By setting a snapshot dependency of a build (for example, build B) on another build's (build A) sources, you can ensure that build B will start only after build A is run and finished. We call build A a dependency build, whereas build B is a dependent build.
Go to the General Settings of the build configuration. Click the orange Show advanced options. Set the Build counter to your desired value. Set the Build number format to %build.
The build checkout directory is a directory on the TeamCity agent machine where all the sources of all builds are checked out into. If you use the agent-side checkout mode, the build agent checks out the sources into this directory before the build.
Each build configuration has a configuration code i.e. bt123 Let's say your Root configuration has the code, bt123, and has a variable called java_dir
Your Sub configuration, can reference it like this
Name: JAVA_DIR Value: %dep.bt123.env.JAVA_DIR%
The easiest way to do this, is to select the small box with lines in the right of the text field, "Value". This will provide a drop list where you should be able to find the variable from bt123.. Just start by typing bt123, and you will see all the variables available.
Hope this helps.
Here is a link to the version 10 documentation regarding dependency properties.
https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties
These options have been available since at least TeamCity 8.x.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With