Don't know if this is the best way to do this but 2 solutions come to mind.. 1.) You can use the jenkins pyhon api to get at this information see module docs. 2.) The job will inject the variable $BUILD_NUMBER into the running environment so publish it to yourself via Jython or bash dumping to a file etc.
On Wednesday, November 28, 2012 4:00:02 AM UTC-8, Shen,Hui wrote: > > Hi guys, > > > > I try to programmatically schedule a new build by posting a message to > > http://HOSTNAME:PORT/jenkins/job/JOBNAME/build > > > > This is worked, a new build was fired, but how can I get the build number > it just fired. > > > > I had try using http://HOSTNAME:PORT/jenkins/job/JOBNAME/lastBuild/, but > it’s not exactly the build number it fired. > > Since there are cases two builds are fired in short time period. > > > > > > Can anybody help with this. Thanks very much. > > > > > > Shen Hui > > BB - F2 - AW264|x28530 > > >
