Starting builds automatically then declared
We generate the major parts of our TeamCity build configurations via scripts that run as build configurations in TeamCity and then use Versioned Settings (Git) to synchronize the changes to TeamCity.
This works fine, but... we would like to immediately start a specific set of builds when these are first declared in TeamCity and that has given us some problems.
When our script runs and generates the needed TeamCity configuration (lots and lots of XML files) and these files are then committed (and pushed) to the Versioned Settings VCS (Git), there is a longer delay before TeamCity has noticed the change, synchronized the files to the config/projects folder, parsed the files and updated the internal database. And by then the script has normally long finished.
We have been looking/talking about a number of solutions, but none of them "feel right".
- we can wait after the script has pushed the commit to the VCS, and poll TeamCity for the change (when the needed build configuration are found in TeamCity REST), and then start a build (again via REST). But this will occupy an agent for some time and the script will take even long than today.
- we can write a new TeamCity plug-in that will monitor the creation of the new build configurations and then start a build - e.g. if a specific property is found in the build. But that is a fair bit of work for something that should be relatively simple.
- we can add a new external REST service that do the same based on the REST interface
But before we venture into any of this, we just need to know if there an authorized way to do this already :-)
Please sign in to leave a comment.
Hi Tonny,
As far as I am aware, there is no direct way to start a build after it (or a different one) has been created, and your approaches seem the most intuitive. I can't currently think of any other way to do this without some degree of tinkering.
From what I understand, you want to trigger a specific set of builds and not those which are newly created, is this correct? It might be possible to use the URL Build trigger to your advantage: https://plugins.jetbrains.com/plugin/9074-url-build-trigger
The idea of using the URL trigger is good.. and I will certainly try it out... but I fear that the problem is the same as before, as the URL trigger will be part of the new project. But I will test it and give you some feed back.
Hi Tonny,
I'll be happy to check your feedback about the idea, but if the builds to trigger are on the newly created project then I agree it will still have the same issue. It might make it easier to work around it with a script but still the same core issue.
In the meantime, please feel free to open a feature request for it in our tracker: https://youtrack.jetbrains.com/issues/TW