How to handle shared configs across multiple versions settings
I have two projects that share part of their tech stack. Both are in their own repositories and each has versioned settings enabled in their repositories. How do you now most cleverly manage, for example, a template including build scripts that should be used in both projects? I would ideally like to manage this also under version control in Kotlin DSL without duplicating the code in both repositories.
Please sign in to leave a comment.
The approach we’re considering is extracting the common logic into a custom Kotlin DSL library—This would allow both projects to reference the same shared code while keeping their own DSL configuration clean and maintainable.
For more detailed information, please refer to https://www.jetbrains.com/help/teamcity/kotlin-dsl.html#Add+Custom+Kotlin+Libraries.
Best Regards,
Tom
Hello Tom,
Thank you for the information. I have two additional questions:
Thank you for the support sebingel
Since you're not very familiar with Java/Kotlin DSL, using recipes would be a helpful approach in your case.
For more detailed guidance, please refer to the documentation here:
https://www.jetbrains.com/help/teamcity/working-with-meta-runner.html#Extract+a+Recipe+From+a+Build+Configuration
Best Regards,
Tom
Hey Tom, thanks for your answer. Recipes have two problems in my scenario:
I have no problem learning Kotlin/Java and creating simple JAR libraries. I just need a starting point, and a TeamCity-centered tutorial would have been a good starting point. If something like this is not available I will need to look in a more generalized resource.
Thank you for the support,
sebingel
Thanks for your detailed information.
Glad to hear that you're interested in learning Kotlin/Java!
If you're looking to use Kotlin with TeamCity, a great starting point is the official documentation on TeamCity Kotlin DSL:
https://www.jetbrains.com/help/teamcity/kotlin-dsl.html
To help you get hands-on quickly, you can also check out this TeamCity Kotlin DSL tutorial series on YouTube:
https://www.youtube.com/watch?v=Mxa-eHMe2w8&list=PLQ176FUIyIUaW-RqAJLbSZe59l6r7t8wp
Additionally, if you plan to create a custom JAR library using IntelliJ IDEA, this video guide might be helpful:
https://www.youtube.com/watch?v=L1ZMVvz1yHU
Best Regards,
Tom