Using the Kotlin DSL without UI changes


   We are trying to automate pipeline creation within our org and would like to use our homegrown cli to create a pipeline as well as configure a project in teamcity. How can we achieve this? We are able to generate kotlin DSL using our templates which are committed to the repos along with the code. How can we utilize something headless to tell the teamcity server to refer to this repo in our git server and create a project associated with the pipeline as well as update whenever a new commit of the dsl is made to the repo? If we cannot do all of this with the dsl, we are fine with doing some part of it using the rest api and would like to avoid having our users to use the UI for configuration. Any help appreciated.

1 comment



there are some ways to approach this:

-the most common scenario is to have a centralized repository for project configurations, then you would create new projects as subprojects of a currently existing one, and they would be automatically detected and added to the server. This would also work if the new projects are being created within the repositories of other existing projects, without needing to centralize every single project into a single repository.

-If you don't want to, and have a headless TeamCity server, where adding a project via the UI and pointing the URL to the repository is not an option, you can create a post request. You could add a new project with the features you require, then add the versioned settings as a project feature. I'd recommend checking a project that you have already set up for the contents that our server will expect to be sent, and replicate the objects:


Please sign in to leave a comment.