Skip to content

hos-p/teamcity-rest-client

 
 

Repository files navigation

teamcity-rest-client JetBrains team project License plugin status Download

Client for TeamCity REST API written in Kotlin. The code snippet below will download *.zip artifacts from the latest successful build with tag publish of the specified build configuration to out directory.

val docs = BuildConfigurationId("Kotlin_StandardLibraryDocumentation")
val build = TeamCityInstanceFactory.guestAuth("https://teamcity.jetbrains.com").builds()
                            .fromConfiguration(docs)
                            .withTag("publish")
                            .latest()
build!!.downloadArtifacts("*.zip", File("out"))

Another snippet will run a build on your own server

val tc = TeamCityInstanceFactory.httpAuth(
        "https://myserver.local", "login", "password")

val buildConfiguration = tc.buildConfiguration(BuildConfigurationId("BuildConfId"))
val build = buildConfiguration.runBuild(
        parameters = mapOf("myparameter1" to "value", "myparameter2" to "value")
)

Published on jcenter

https://bintray.com/bintray/jcenter?filterByPkgName=teamcity-rest-client

You can add the dependency in your build.gradle file:

repositories {
    jcenter()
}

dependencies {
    compile "org.jetbrains.teamcity:teamcity-rest-client:PACKAGE_VERSION"
}

Contributing

Your contributions are welcome, please read the CONTRIBUTING.md for details.

About

Client for TeamCity REST API written in Kotlin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 99.7%
  • Java 0.3%