Check build logs and buildids from teamcity openApi?
hi all..am new to teamcity....we run some command line scripts in teamcity..Each of the teamcity build has 1 script under it. After run of each script
and hence each build, I need to check for certain messages/string in that build's log and take action based on those log messages.
I went through teamcity api and found 3 necessary interfaces/classes:-
SBuildServer ----> BuildLookupService ---> BuildLogReader.
The problem is that SBuildServer requires many initilization parameters like buildid, buildnumber, buildtype.
How can I information about these parameters from teamcity?. Eg:- What is the parameter that keeps
track of last completed build or last failed build id.
Please sign in to leave a comment.
Probably this will help: http://www.jetbrains.net/confluence/display/TCD4/Server-side+Object+Model
--
Pavel Sher
thanks pavel for that link...I wrote a small class that just extends BuildServerAdapter, similar to one given in sample..Then , I created 1 xml
plugin file
The class is as follows:-
I created a zip folder with this class file and plugin xml and kept in <teamcity-home>\webapps\ROOT\WEB-INF\plugins. After I stopped and restarted
server, I was able to see plugin in .unpacked folder. Then I checked at teamcity-server log file.
However, I was not able to find any sys.out println messages regarding this plugin in that log file. I am unable to understand the issue here. Why isnt this
thing working?.My plugin is not getting registered...Can you please provide any tip on this. The only messages related to my plugin in log file were:-
Appreciate your help on this...
Could you please attach the whole zip file?
--
Pavel Sher
Hello,
To send messages to teamcity-server.log file you should use Log4J logging, and not system.out.println. System.out.println
messages will appear only in TeamCity console and catalina.out file (if you have this file in TeamCity/logs directory).
Regards,
KIR
pavel and kir...thanks for your help. Yes, i was late to realize all sys println messages were sent to tomcat console and
not in teamcity server file. However, some of the messages did go to <TeamcityHome>/logs/stdout_date file. It seems that
the plugin is working okay.
However, I had few queries on it:-
"Teamcity build agent" and "Teamcity web server" services are not "enabled/on" always. Atleast, I have to manually
kick off 2nd service even though I have set it to "automatic" mode. The problem is that plugin is not working always.
One thing that I have noted is when the plugin is not working, I do not get a "stdout" file in logs. But teamcity works just fine.
Pl note that I have teamcity server and agent are installed on 1 machine.