APIs to get 'Fail build if:' options for a build configuration.

Hi,

Does anybody have idea from which API's I can get the values of Fail build if: options which include

build process exit code is not zero
at least one test failed etc.

Also I want to know the API's for Build Options.

These settings are in the General Settings page of Build Configuration.

Any help is appreciated.

thanks in advance


6 comments
Comment actions Permalink

Please take a look at jetbrains.buildServer.serverSide.BuildTypeOptions interface.
SBuildType implements it. In order to obtain value of a concrete option use getOption() method.

0
Comment actions Permalink

Hi Pavel,
Can you please tell me how to find the version of the selected runner in a build configuration. I tried with (sBuild.getBuildRunner( )).getDecription( ) but it gave me only the selected runner name. I also need to know the java home path and version set for a particular build.

Thanks and regards,
Shibu

0
Comment actions Permalink

Shibu,

What do you mean by "version of the selected runner"? Any examples?

To get settings of the dfined build steps you will need something like SBuildType.getBuildRunners()[i].getParameters()

0
Comment actions Permalink

Hi Yegor,
     First of all I would like to thank you for your immediate response.
By version i mean something like a scenario like this : - Suppose from the available runner option I chose maven2. But in the maven home path field I can explicitly overide the path to a \bin location of some other version of maven (Eg. Maven3.0). So now the build will be actually using Maven version 3.0. So I want to know the actual version of build runner being chosen for a particular build.
     In a very similar way build can also use other versions of java. I also want to know that.
     I tried with SBuildType.getRunners(), but as i am using TeamCity versin 5.3.1 I could not use the method. can you pls tell me the repository url to download the latest teamcity version.
     I am not sure whether I am in the right track. So please let me know about it and whether there is any other better approach.Looking forward for your support.
Thanks in advance,
Shibu

0
Comment actions Permalink

Shibu,

You are right, I mentioned the API from TeamCity 6.0+ for earier versions you will need to use
SBuildType.getRunParameters()
and then using the parameter name that you can get looking into .BuildServer\config\<project name>\project-config.xml

BTW, did you consider upgrading? Apart from fixes and improvements, we usually do not release updates to not recent TeamCity versions, so staying on the latest will ensure we can investigate and fix issues if they appear.

0
Comment actions Permalink

Yegor,
Thanks a lot for your guidance. I think i have got into the right track. I will probably try to get into the latest version of teamcity. It was really helpful and in time.
Thanks and regards,
Shibu

0

Please sign in to leave a comment.