简体   繁体   English

如何在TeamCity中以编程方式创建项目和构建类型?

[英]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.

相关问题 TeamCity ::如何在Java中访问teamcity构建ID - TeamCity :: How can I access teamcity build ID in Java 您如何以编程方式创建信任/密钥库? - How do you create trust/keystores programatically? 您如何以编程方式触发ComponentListener? - How can you fire ComponentListener programatically? 可以为很多项目做一个集中​​式的 build.gradle 吗? - Can you make a centralized build.gradle for many projects? 如何使TeamCity构建参数动态化? - How can I make TeamCity build parameters dynamic? 如何以编程方式获取Apache项目上托管的项目的详细信息(我们有API)吗? - How can I get details of Projects hosted on Apache Projects Programatically (Do we have API)? 如何创建可被多个Android项目重用的类的jar文件? - How do you create a jar file of classes that can be re-used by multiple Android projects? 如何在Java中创建一个创建通用类但限制可以使用的类型? - How to create a create a generic class in Java but limit what types you can use? 如何使用一个构建文件在Ant中构建多个项目? - How can I build multiple projects in Ant with one build file? 你怎么能以编程方式取消从InputStream读取? - How can you programatically cancel reading from an InputStream?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM