Example usage - running a build with parameters
Dafnafrank opened this issue · 2 comments
Dafnafrank commented
Are there example usages on how to run a build including passing parameters to the build?
(Preferably in Java...)
shalupov commented
Unfortunately not in master yet, it's in build-and-tests branch, #45
You may use it via https://jitpack.io/#JetBrains/teamcity-rest-client/builds-and-tests-SNAPSHOT
import org.jetbrains.teamcity.rest.Build;
import org.jetbrains.teamcity.rest.BuildConfigurationId;
import org.jetbrains.teamcity.rest.TeamCityInstance;
import org.jetbrains.teamcity.rest.TeamCityInstanceFactory;
public class Program {
public static void main(String[] args) {
final TeamCityInstance tc = TeamCityInstanceFactory.httpAuth("https://myserver", "login", "password");
final BuildConfigurationId confId = new BuildConfigurationId("BuildConfId");
final Build build = tc.buildConfiguration(confId).runBuild();
}
}
shalupov commented
This API is not complete and various ways to do something on TeamCity server will be added along the way. So if you need to do something unsupported, please open an issue or (better!) provide a PR.