[英]How can you programatically create projects and build types in TeamCity?
I have been studying the TeamCity OpenAPI and I'm trying to figure out if it's possible to create new projects and build types programatically. 我一直在研究TeamCity OpenAPI,并且试图找出是否有可能以编程方式创建新项目和构建类型。 As far as I understand, it's not exactly possible via the REST API.
据我了解,通过REST API并非完全可能。
Could somebody explain how this works and if it at all can be done? 有人可以解释一下它是如何工作的,是否可以做到? Any examples or pointers to existing plugins which already do this, would be highly appreciated
任何已经这样做的示例或指向现有插件的指针,将不胜感激
Actually you can create projects and build configurations with help of TeamCity REST API, see: http://confluence.jetbrains.com/display/TW/REST+API+Plugin#RESTAPIPlugin-ProjectSettings 实际上,您可以在TeamCity REST API的帮助下创建项目和构建配置,请参阅: http : //confluence.jetbrains.com/display/TW/REST+API+Plugin#RESTAPIPlugin-ProjectSettings
But if you prefer using Open API, then you need to obtain jetbrains.buildServer.serverSide.ProjectManager spring bean and use it like this: 但是,如果您更喜欢使用Open API,则需要获取jetbrains.buildServer.serverSide.ProjectManager弹簧bean并按以下方式使用它:
ProjectManager pm;
SProject p = pm.createProject("my project name"):
SBuildType bt = p.createBuildType("my build type name");
and so on. 等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.