How do I access all Job Configuration properties in my Plugin code?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I access all Job Configuration properties in my Plugin code?

Quadir Sha Kareemullah
Hi,

I would greatly appreciate if anyone can tell me how I can access all Job Configuration properties in my Plugin code. I tried following snippet, but pdp is returning null.

 
ParametersDefinitionProperty pdp = this.project.getProperty(ParametersDefinitionProperty.class);
 

Here is little background, I am trying to dynamically set the branch name that Git needs to build. In the Job Configuration, I enter ${pull_req_src_branch} for the field "Branches to build Branch Specifier (blank for 'any')". I want to set this value dynamically in my Plugin code when the Jobs runs.

Any help is greatly appreciated.

Thanks
Quadir
 

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: How do I access all Job Configuration properties in my Plugin code?

Sandell, Robert-2

You could try and implement a BuildChooser: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/BuildChooser.java

 

 

 

Robert Sandell

Software Tools Engineer - SW Environment and Product Configuration

Sony Mobile Communications

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Quadir Sha Kareemullah
Sent: den 30 juni 2014 07:14
To: [hidden email]
Subject: How do I access all Job Configuration properties in my Plugin code?

 

Hi,

 

I would greatly appreciate if anyone can tell me how I can access all Job Configuration properties in my Plugin code. I tried following snippet, but pdp is returning null.

 

 
ParametersDefinitionProperty pdp = this.project.getProperty(ParametersDefinitionProperty.class);

 

 

Here is little background, I am trying to dynamically set the branch name that Git needs to build. In the Job Configuration, I enter ${pull_req_src_branch} for the field "Branches to build Branch Specifier (blank for 'any')". I want to set this value dynamically in my Plugin code when the Jobs runs.

 

Any help is greatly appreciated.

 

Thanks

Quadir

 

--
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How do I access all Job Configuration properties in my Plugin code?

Quadir Sha Kareemullah
Hi Robert,

Thanks for your reply. I was NOT able to figure out how to use BuildChooser to get all configuration properties of a Job (not Build). I would greatly appreciate if you can provide a sample code snippet.

Thanks
Quadir

On Monday, June 30, 2014 1:33:36 PM UTC+5:30, Robert Sandell wrote:

You could try and implement a BuildChooser: <a href="https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/BuildChooser.java" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fhudson%2Fplugins%2Fgit%2Futil%2FBuildChooser.java\46sa\75D\46sntz\0751\46usg\75AFQjCNHGSjxp0lez_NfSIv2TKsNr-1koNg';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fhudson%2Fplugins%2Fgit%2Futil%2FBuildChooser.java\46sa\75D\46sntz\0751\46usg\75AFQjCNHGSjxp0lez_NfSIv2TKsNr-1koNg';return true;">https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/BuildChooser.java

 

 

 

Robert Sandell

Software Tools Engineer - SW Environment and Product Configuration

Sony Mobile Communications

 

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="_8-blQR_z_oJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jenkin...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="_8-blQR_z_oJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jenkin...@googlegroups.com] On Behalf Of Quadir Sha Kareemullah
Sent: den 30 juni 2014 07:14
To: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="_8-blQR_z_oJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jenkin...@...
Subject: How do I access all Job Configuration properties in my Plugin code?

 

Hi,

 

I would greatly appreciate if anyone can tell me how I can access all Job Configuration properties in my Plugin code. I tried following snippet, but pdp is returning null.

 

 
ParametersDefinitionProperty pdp = this.project.getProperty(ParametersDefinitionProperty.class);

 

 

Here is little background, I am trying to dynamically set the branch name that Git needs to build. In the Job Configuration, I enter ${pull_req_src_branch} for the field "Branches to build Branch Specifier (blank for 'any')". I want to set this value dynamically in my Plugin code when the Jobs runs.

 

Any help is greatly appreciated.

 

Thanks

Quadir

 

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="_8-blQR_z_oJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jenkinsci-de...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: How do I access all Job Configuration properties in my Plugin code?

Sandell, Robert-2

My idea was more around not using parameters but instead configure the git plugin to use your buildchooser to provide what to build, my assumption was that the rest of your plugin code had the necessary information needed for the buildchooser to use.

You can see examples of BuildChooser implementations on the wiki: https://wiki.jenkins-ci.org/display/JENKINS/Extension+points#Extensionpoints-hudson.plugins.git.util.BuildChooser

And here is one from my plugin: https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java

 

 

 

 

Robert Sandell

Software Tools Engineer - SW Environment and Product Configuration

Sony Mobile Communications

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Quadir Sha Kareemullah
Sent: den 1 juli 2014 08:00
To: [hidden email]
Subject: Re: How do I access all Job Configuration properties in my Plugin code?

 

Hi Robert,

 

Thanks for your reply. I was NOT able to figure out how to use BuildChooser to get all configuration properties of a Job (not Build). I would greatly appreciate if you can provide a sample code snippet.

 

Thanks

Quadir

On Monday, June 30, 2014 1:33:36 PM UTC+5:30, Robert Sandell wrote:

You could try and implement a BuildChooser: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/BuildChooser.java

 

 

 

Robert Sandell

Software Tools Engineer - SW Environment and Product Configuration

Sony Mobile Communications

 

From: <a href="javascript:" target="_blank">jenkin...@... [mailto:<a href="javascript:" target="_blank">jenkin...@...] On Behalf Of Quadir Sha Kareemullah
Sent: den 30 juni 2014 07:14
To: <a href="javascript:" target="_blank">jenkin...@...
Subject: How do I access all Job Configuration properties in my Plugin code?

 

Hi,

 

I would greatly appreciate if anyone can tell me how I can access all Job Configuration properties in my Plugin code. I tried following snippet, but pdp is returning null.

 

 
ParametersDefinitionProperty pdp = this.project.getProperty(ParametersDefinitionProperty.class);

 

 

Here is little background, I am trying to dynamically set the branch name that Git needs to build. In the Job Configuration, I enter ${pull_req_src_branch} for the field "Branches to build Branch Specifier (blank for 'any')". I want to set this value dynamically in my Plugin code when the Jobs runs.

 

Any help is greatly appreciated.

 

Thanks

Quadir

 

--
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 <a href="javascript:" target="_blank">jenkinsci-de...@....
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How do I access all Job Configuration properties in my Plugin code?

felipesfaraco
In reply to this post by Quadir Sha Kareemullah
Have you ever found out the solution to this? I was looking to access the Git steps configuration directly. 

On Sunday, June 29, 2014 at 10:14:12 PM UTC-7, Quadir Sha Kareemullah wrote:
Hi,

I would greatly appreciate if anyone can tell me how I can access all Job Configuration properties in my Plugin code. I tried following snippet, but pdp is returning null.

 
ParametersDefinitionProperty pdp = this.project.getProperty(ParametersDefinitionProperty.class);
 

Here is little background, I am trying to dynamically set the branch name that Git needs to build. In the Job Configuration, I enter ${pull_req_src_branch} for the field "Branches to build Branch Specifier (blank for 'any')". I want to set this value dynamically in my Plugin code when the Jobs runs.

Any help is greatly appreciated.

Thanks
Quadir
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/71342d59-9d4a-44bf-871e-92b9f4b61538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.