Re: get build number

2015-09-13 Thread Thilina Madhusanka
Hi

thanks a lot. 

Thilina.

On Thursday, September 3, 2015 at 6:05:16 PM UTC+5:30, Christopher wrote:
>
> Most likely the plugin has a perform() method with an AbstractBuild. 
>
> Call getNumber() on the build. 
>
>
> http://javadoc.jenkins-ci.org/hudson/tasks/BuildStepCompatibilityLayer.html#perform(hudson.model.AbstractBuild,
>  
>
> hudson.Launcher, hudson.model.BuildListener) 
> http://javadoc.jenkins-ci.org/hudson/model/Run.html#getNumber() 
>
>
> On 03/09/15 12:21, Thilina Madhusanka wrote: 
> > Hi 
> > 
> > im trying to modify a plugin, that plugin generate a report i need to 
> > add the build number to the report name 
> > 
> > thanks 
> > 
> > On Thursday, September 3, 2015 at 3:41:50 PM UTC+5:30, Victor Martinez 
> > wrote: 
> > 
> > Alright, 
> > 
> > Are you developing a new jenkins plugin? Or you mean configuring a 
> > jenkins job? If so, please refs the below page: 
> > 
> > - 
> https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
>  
> > <
> https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables>
>  
>
> > 
> > And also use jenkinsci-users mailing list or IRC for such topics 
> > since this mailing list is for Jenkins core and plugins development 
> > discussions 
> > 
> > Cheers 
> > 
> > 
> > 
> > On Thursday, 3 September 2015 10:27:42 UTC+2, Thilina Madhusanka 
> wrote: 
> > 
> > Hi 
> > 
> > thanks for the reply 
> > 
> > im new to this. my plugin will start as a post build option in 
> > jenkis so which  methods should i use? 
> > 
> > can u tell me how can i get the number in string or int format? 
> > 
> > thanks. 
> > 
> > On Thursday, September 3, 2015 at 12:10:49 PM UTC+5:30, Victor 
> > Martinez wrote: 
> > 
> > Hi, 
> > 
> >  It depends on what you need to do. Check the below javadoc: 
> > 
> >  - From a particular Jenkins job you can query its latest 
> > build: 
> > 
> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
>  
> > <
> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()>
>  
>
> >   
> >  - From a particular Job build you can query its current 
> > build number: 
> > http://javadoc.jenkins-ci.org/hudson/model/Run.html#number 
> >  
>
> > 
> > Cheers 
> > 
> > 
> > On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina 
> > Madhusanka wrote: 
> > 
> > hi 
> > 
> > Is there a method to retrieve current  build number for 
> > a plugin to use. ? 
> > 
> > thanks 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Jenkins Developers" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to jenkinsci-de...@googlegroups.com  
> > . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/jenkinsci-dev/3ececc8d-e84b-4233-8ac6-104e1dc152f5%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/jenkinsci-dev/3ececc8d-e84b-4233-8ac6-104e1dc152f5%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/d06e6c00-3c90-4077-b16d-eb7f3f4bd9e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


get build number

2015-09-03 Thread Thilina Madhusanka
hi

Is there a method to retrieve current  build number for a plugin to use. ?

thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/58383e57-f8b9-4d7e-a89e-6f21cba3ba8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get build number

2015-09-03 Thread Thilina Madhusanka
Hi

thanks for the reply

im new to this. my plugin will start as a post build option in jenkis so 
which  methods should i use? 

can u tell me how can i get the number in string or int format?

thanks.

On Thursday, September 3, 2015 at 12:10:49 PM UTC+5:30, Victor Martinez 
wrote:
>
> Hi,
>
>  It depends on what you need to do. Check the below javadoc:
>
>  - From a particular Jenkins job you can query its latest build: 
> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
>  
>  - From a particular Job build you can query its current build number: 
> http://javadoc.jenkins-ci.org/hudson/model/Run.html#number
>
> Cheers
>
>
> On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina Madhusanka wrote:
>>
>> hi
>>
>> Is there a method to retrieve current  build number for a plugin to use. ?
>>
>> thanks
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/5a4849ab-0fc4-4157-98fb-0ce6db6b59bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get build number

2015-09-03 Thread Victor Martinez
Hi,

 It depends on what you need to do. Check the below javadoc:

 - From a particular Jenkins job you can query its latest build: 
http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
 
 - From a particular Job build you can query its current build number: 
http://javadoc.jenkins-ci.org/hudson/model/Run.html#number

Cheers


On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina Madhusanka wrote:
>
> hi
>
> Is there a method to retrieve current  build number for a plugin to use. ?
>
> thanks
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b05cb39f-e86b-4c4f-a83f-8c861306e644%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get build number

2015-09-03 Thread Victor Martinez
Alright, 

Are you developing a new jenkins plugin? Or you mean configuring a jenkins 
job? If so, please refs the below page:

- 
https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables

And also use jenkinsci-users mailing list or IRC for such topics since this 
mailing list is for Jenkins core and plugins development discussions

Cheers



On Thursday, 3 September 2015 10:27:42 UTC+2, Thilina Madhusanka wrote:
>
> Hi
>
> thanks for the reply
>
> im new to this. my plugin will start as a post build option in jenkis so 
> which  methods should i use? 
>
> can u tell me how can i get the number in string or int format?
>
> thanks.
>
> On Thursday, September 3, 2015 at 12:10:49 PM UTC+5:30, Victor Martinez 
> wrote:
>>
>> Hi,
>>
>>  It depends on what you need to do. Check the below javadoc:
>>
>>  - From a particular Jenkins job you can query its latest build: 
>> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
>>  
>>  - From a particular Job build you can query its current build number: 
>> http://javadoc.jenkins-ci.org/hudson/model/Run.html#number
>>
>> Cheers
>>
>>
>> On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina Madhusanka wrote:
>>>
>>> hi
>>>
>>> Is there a method to retrieve current  build number for a plugin to use. 
>>> ?
>>>
>>> thanks
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a9f54df3-f82a-4720-b28a-df753649d2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get build number

2015-09-03 Thread Thilina Madhusanka
Hi

im trying to modify a plugin, that plugin generate a report i need to add 
the build number to the report name

thanks

On Thursday, September 3, 2015 at 3:41:50 PM UTC+5:30, Victor Martinez 
wrote:
>
> Alright, 
>
> Are you developing a new jenkins plugin? Or you mean configuring a jenkins 
> job? If so, please refs the below page:
>
> - 
> https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
>
> And also use jenkinsci-users mailing list or IRC for such topics since 
> this mailing list is for Jenkins core and plugins development discussions
>
> Cheers
>
>
>
> On Thursday, 3 September 2015 10:27:42 UTC+2, Thilina Madhusanka wrote:
>>
>> Hi
>>
>> thanks for the reply
>>
>> im new to this. my plugin will start as a post build option in jenkis so 
>> which  methods should i use? 
>>
>> can u tell me how can i get the number in string or int format?
>>
>> thanks.
>>
>> On Thursday, September 3, 2015 at 12:10:49 PM UTC+5:30, Victor Martinez 
>> wrote:
>>>
>>> Hi,
>>>
>>>  It depends on what you need to do. Check the below javadoc:
>>>
>>>  - From a particular Jenkins job you can query its latest build: 
>>> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
>>>  
>>>  - From a particular Job build you can query its current build number: 
>>> http://javadoc.jenkins-ci.org/hudson/model/Run.html#number
>>>
>>> Cheers
>>>
>>>
>>> On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina Madhusanka wrote:

 hi

 Is there a method to retrieve current  build number for a plugin to 
 use. ?

 thanks



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/3ececc8d-e84b-4233-8ac6-104e1dc152f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get build number

2015-09-03 Thread Christopher Orr
Most likely the plugin has a perform() method with an AbstractBuild.

Call getNumber() on the build.

http://javadoc.jenkins-ci.org/hudson/tasks/BuildStepCompatibilityLayer.html#perform(hudson.model.AbstractBuild,
hudson.Launcher, hudson.model.BuildListener)
http://javadoc.jenkins-ci.org/hudson/model/Run.html#getNumber()


On 03/09/15 12:21, Thilina Madhusanka wrote:
> Hi
> 
> im trying to modify a plugin, that plugin generate a report i need to
> add the build number to the report name
> 
> thanks
> 
> On Thursday, September 3, 2015 at 3:41:50 PM UTC+5:30, Victor Martinez
> wrote:
> 
> Alright, 
> 
> Are you developing a new jenkins plugin? Or you mean configuring a
> jenkins job? If so, please refs the below page:
> 
> - 
> https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
> 
> 
> 
> And also use jenkinsci-users mailing list or IRC for such topics
> since this mailing list is for Jenkins core and plugins development
> discussions
> 
> Cheers
> 
> 
> 
> On Thursday, 3 September 2015 10:27:42 UTC+2, Thilina Madhusanka wrote:
> 
> Hi
> 
> thanks for the reply
> 
> im new to this. my plugin will start as a post build option in
> jenkis so which  methods should i use? 
> 
> can u tell me how can i get the number in string or int format?
> 
> thanks.
> 
> On Thursday, September 3, 2015 at 12:10:49 PM UTC+5:30, Victor
> Martinez wrote:
> 
> Hi,
> 
>  It depends on what you need to do. Check the below javadoc:
> 
>  - From a particular Jenkins job you can query its latest
> build:
> 
> http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getLastBuild()
> 
> 
>  
>  - From a particular Job build you can query its current
> build number:
> http://javadoc.jenkins-ci.org/hudson/model/Run.html#number
> 
> 
> Cheers
> 
> 
> On Thursday, 3 September 2015 08:30:20 UTC+2, Thilina
> Madhusanka wrote:
> 
> hi
> 
> Is there a method to retrieve current  build number for
> a plugin to use. ?
> 
> thanks
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jenkinsci-dev+unsubscr...@googlegroups.com
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/3ececc8d-e84b-4233-8ac6-104e1dc152f5%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/55E83E7A.6030901%40orr.me.uk.
For more options, visit https://groups.google.com/d/optout.


Re: How can i get build number when using remote API

2012-11-29 Thread John Sirois
It would be great if the BUILDS could be user-keyed to prevent this.  Then
the client could send say a guid as the build id, and retrieve the build
result later by either build number _or_ id.


On Thu, Nov 29, 2012 at 11:11 AM, Jesse Glick jgl...@cloudbees.com wrote:

 On Wed, Nov 28, 2012 at 7:00 AM, Shen,Hui shenhu...@baidu.com wrote:
  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.

 In general I think you cannot do this. The job may be sitting in the
 queue for a while waiting for an executor, so this API cannot return a
 synchronous result that includes a build number which might not be
 determined for another hour!

 That said, it would be worth considering the ability to pass an
 arbitrary cookie (such as a random UUID) to the /build API which would
 be recorded in the build cause. Then your remote client could poll the
 build list until it finds one with a matching cause. The trouble is
 that you could be waiting forever if the queue item is canceled before
 any build is started. So the cookie might need to be included in the
 remote API information about the build queue, too, maybe with a list
 of (recently?) canceled items with associated cookies. Not a simple
 API design problem.




-- 
John Sirois
303-512-3301


Re: How can i get build number when using remote API

2012-11-29 Thread John Sirois
On Thu, Nov 29, 2012 at 11:14 AM, John Sirois jsir...@twitter.com wrote:

 It would be great if the BUILDS could be user-keyed to prevent this.  Then
 the client could send say a guid as the build id, and retrieve the build
 result later by either build number _or_ id.


To be clear - I'm suggesting this be a 1st level concept in jenkins api and
core code.




 On Thu, Nov 29, 2012 at 11:11 AM, Jesse Glick jgl...@cloudbees.comwrote:

 On Wed, Nov 28, 2012 at 7:00 AM, Shen,Hui shenhu...@baidu.com wrote:
  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.

 In general I think you cannot do this. The job may be sitting in the
 queue for a while waiting for an executor, so this API cannot return a
 synchronous result that includes a build number which might not be
 determined for another hour!

 That said, it would be worth considering the ability to pass an
 arbitrary cookie (such as a random UUID) to the /build API which would
 be recorded in the build cause. Then your remote client could poll the
 build list until it finds one with a matching cause. The trouble is
 that you could be waiting forever if the queue item is canceled before
 any build is started. So the cookie might need to be included in the
 remote API information about the build queue, too, maybe with a list
 of (recently?) canceled items with associated cookies. Not a simple
 API design problem.




 --
 John Sirois
 303-512-3301









-- 
John Sirois
303-512-3301