I wrote a plug-in for the jetbrains tool teamcity. It is pretty much just a server listener that listens for a build being triggered and outputs some text files with information about different builds like what triggered it, how many changes there where ect ect. After I finished that I wrote a python script that could input info into teamcity while the server is running and kick of a build. I would like to be able to get the artifacts for that build after the build is ran, but the problem is I don't know how long it takes each build to run. Sometimes it is 30 sec other times 30 minutes.
So I am kicking off the build with this line in python.
urllib.urlopen('http://'+username+':'+password+'@localhost/httpAuth/action.html?add2Queue='+btid+'&system.name=<btid>&system.value=<'+btid+'>&system.name=<buildNumber>&system.value=<'+buildNumber+'>')
After the build runs (some indetermined amount of time) I would like to use this line to get my text file.
urllib.urlopen('http://'+username+':'+password+'@localhost/httpAuth/action.html?add2Queue='+btid+'&system.name=<btid>&system.value=<'+btid+'>&system.name=<buildNumber>&system.value=<'+buildNumber+'>')
Again the problem is I don't know how long to wait before executing the second line. Usually in Java I would do a second thread of sorts that sleeps for a certain amount of time and waits for the build to be done. I am not sure how to do this in python. So if anyone has an idea of either how to do this in python OR a better way to do this I would appreciate it. If I need to explain myself better please let me know.
Grant-