Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2019-01-30 Thread Cristian Banarescu
Hey man! Your solution also worked for me! Thank you very much! miercuri, 25 februarie 2015, 22:39:06 UTC+2, Victor Volle a scris: > > I have a partial *solution, *when I have already enabled Global > Properties: > > > <https://lh4.googleusercontent.com/-EJJeUHpiDSs/VO4yDdXk

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2018-08-05 Thread Nick Mellor
the problem appears to be hudson.slaves.EnvironmentVariablesNodeProperty.class passed as a parameter, but which can't be serialised. On Monday, 6 August 2018 11:24:34 UTC+10, Nick Mellor wrote: > > Just to be clear: I had working code in Jenkins 2.19 that looked like this: > > def appVersion(St

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2018-08-05 Thread Nick Mellor
Just to be clear: I had working code in Jenkins 2.19 that looked like this: def appVersion(String app, incrementPatch = true) { assert app.toLowerCase() in ['appName'], "No such project implemented: '$app'" def version = [ elms: env.VERSION_OVERRIDE, lacm: env.LACM_VERSION

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2018-08-05 Thread Nick Mellor
Hi Zilla, this doesn't work for me. I get: java.io.NotSerializableException: hudson.slaves.EnvironmentVariablesNodeProperty Any ideas? Thanks, Nick On Friday, 27 July 2018 01:14:23 UTC+10, ZillaYT wrote: > > I just had to do this to fix it. > > Jenkins instance = Jenkins.getInstance() > de

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2018-02-07 Thread Victor Volle
Which error(s)? On Wednesday, February 7, 2018 at 11:36:50 AM UTC+1, Rakesh Bachu wrote: > > Hi, > This script works fine when tested from > So i want to do this with a job or a pipeline > how can i make a job or pipeline run this groovy script. > > i'm getting random errors when I try to run thi

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2018-02-07 Thread Rakesh Bachu
Hi, This script works fine when tested from So i want to do this with a job or a pipeline how can i make a job or pipeline run this groovy script. i'm getting random errors when I try to run this groovy script as part of a pipleline. Thanks, Rakesh On Thursday, February 26, 2015 at 3:23:27 AM U

Passing Data From Groovy Post Build To Post Build Task Via Global Properties

2018-01-26 Thread santhosh soma
Hi All, I have written groovy script to set the global environment variables as part of the post build groovy step. I could able to the set the properties but the properties are not refreshing by default while running next build. Is there any way to refresh the global properties once we set

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2017-11-10 Thread Josh Branham
Solved the problem, just add an envVars.clear() to the else statement On Thursday, November 9, 2017 at 3:58:36 PM UTC-5, Josh Branham wrote: > > Any idea how to make this delete all existing key pairs to ensure only the > ones defined in this script are the ones in Jenkins? > > On Wednesday, Fe

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2017-11-09 Thread Josh Branham
Any idea how to make this delete all existing key pairs to ensure only the ones defined in this script are the ones in Jenkins? On Wednesday, February 25, 2015 at 4:53:27 PM UTC-5, Victor Volle wrote: > > Final solution: > > instance = Jenkins.getInstance() > globalNodeProperties = instance.getG

Global properties - Environment variables displayed wrongly on GUI

2017-05-15 Thread Limor Shemesh
i'm using Jenkins 2.60 - on the Manage Jenkins - Configure System - the Global properties - Environment variables - display the same variable as the number of the variables that defined in config.xml. In the config.xml the variables are correct. Is it known issue? Is there something I can

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2015-02-25 Thread Victor Volle
Final solution: instance = Jenkins.getInstance() globalNodeProperties = instance.getGlobalNodeProperties() envVarsNodePropertyList = globalNodeProperties.getAll(hudson.slaves. EnvironmentVariablesNodeProperty.class) newEnvVarsNodeProperty = null envVars = null if ( envVarsNodePropertyList == nul

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2015-02-25 Thread Victor Volle
I have a partial *solution, *when I have already enabled Global Properties: <https://lh4.googleusercontent.com/-EJJeUHpiDSs/VO4yDdXk2vI/ACY/UDR7x-oUvJo/s1600/Configure%2BSystem%2B[Jenkins]%2B2015-02-25%2B21-35-00.png> the following script works for me: import jenkins.*

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2015-01-20 Thread Jonathann Zenou
the global configuration, thus next time >> when I go into the Global Jenkins Configuration UI, I could see the >> username or password in the section "Global properties". >> >> Is this possible? Is there a package like "hudson.configuration.global"

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2014-09-29 Thread mr
variable (like > e.g. username or password) into the global configuration, thus next time > when I go into the Global Jenkins Configuration UI, I could see the > username or password in the section "Global properties". > > Is this possible? Is there a package like "h

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2014-09-23 Thread mr
Configuration UI, I could see the username or password in the section "Global properties". Is this possible? Is there a package like "hudson.configuration.global" within the API which would allow me to change the environment variable within the global properties jenkins c

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2014-09-22 Thread Walter Kacynski
I use the following script to inject a username and password: usernamePassword = build.getEnvironment(null)[secret] def (username, password) = usernamePassword.split(':') e = new hudson.EnvVars() e.put(secret + '_USERNAME', username) e.put(secret + '_PASSWORD', password) build.environments.add(hu

Re: How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2014-09-22 Thread mr
Hi Folks! Do anybody have an idea how to set/change the variables within a Groovy script? Regards! -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-

How to set "Environment variables" in "Global properties" of global Jenkins configuration programmatically?

2014-09-19 Thread mr
Hi! I have some environment variables as List of key-value pairs within the "Global properties" section of the global Jenkins configuration. I wonder if it is possible to change such a environment variables programmatically, for example by means of a Groovy script? Regards, m

Re: global properties

2013-09-30 Thread Les Mikesell
On Thu, Sep 26, 2013 at 12:01 PM, Tânia Magalhães wrote: > Yes, of course there is a logic behind my needs... > I just think that it is useless explain the all process here. By 'logic' I meant some external program driving/controlling the choice of the build node at any particular time. If ther

Re: global properties

2013-09-26 Thread Baptiste Mathus
gt; >> > Since we have that global property and since we still have to deal with >> > forcing some jobs to run at main slave, even if we just have to delete the >> > label main_slave from one slave and add it to another, it woul be much >> > better if we can deal

Re: global properties

2013-09-26 Thread Tânia Magalhães
nd add it to another, it woul be much > > better if we can deal both problems on the same way, and to me it seems > > clear that using global properties would be the best choice. All I need > is > > to find a way to use global properties values at "restrict where...&q

Re: global properties

2013-09-24 Thread Les Mikesell
eal with > forcing some jobs to run at main slave, even if we just have to delete the > label main_slave from one slave and add it to another, it woul be much > better if we can deal both problems on the same way, and to me it seems > clear that using global properties would be the

Re: global properties

2013-09-24 Thread Tânia Magalhães
add it to another, it woul be much better if we can deal both problems on the same way, and to me it seems clear that using global properties would be the best choice. All I need is to find a way to use global properties values at "restrict where..." Terça-feira, 24 de Setembro de

Re: global properties

2013-09-24 Thread Les Mikesell
On Tue, Sep 24, 2013 at 10:04 AM, Tânia Magalhães wrote: > Well... because it would be much easier to change the value for my main > slave in just one place, rather than have to go from job to job and change > the label expression for "restrict where this project can be run". If the node role cha

Re: global properties

2013-09-24 Thread Tânia Magalhães
Thanks for your answer, but it does not work. Building a job with ${MAIN_SLAVE} at "restrict where ..." results on: [image: 100%] Build History[image: pending] #1 [image: cancel this build] (pending—All nodes of label ‘${MAIN_SLAVE}

Re: global properties

2013-09-24 Thread Tânia Magalhães
Well... because it would be much easier to change the value for my main slave in just one place, rather than have to go from job to job and change the label expression for "restrict where this project can be run". To make it clear: - I have severall nodes - a lot of jobs - some of them must run

Re: global properties

2013-09-24 Thread alok kumar
Try ${MAIN_SLAVE}. That should work On Tue, Sep 24, 2013 at 8:10 PM, Tânia Magalhães wrote: > Hi! > > Under "Restrict where this project can be run", it is possible at label > expression add a global property key (name) ? > > I have a global property named MAIN_SLAVE which value sometimes change

Re: global properties

2013-09-24 Thread Les Mikesell
On Tue, Sep 24, 2013 at 9:40 AM, Tânia Magalhães wrote: > Hi! > > Under "Restrict where this project can be run", it is possible at label > expression add a global property key (name) ? > > I have a global property named MAIN_SLAVE which value sometimes changes. And > I have some jobs that I want

global properties

2013-09-24 Thread Tânia Magalhães
Hi! Under "Restrict where this project can be run", it is possible at label expression add a global property key (name) ? I have a global property named MAIN_SLAVE which value sometimes changes. And I have some jobs that I want to run in that main slave. I already tried to add %MAIN_SLAVE% to l

Re: Global Properties

2012-08-22 Thread MikeyG
I've given up on this idea. Will probably run with writing some script/code that injects values into the config files, then restart Jenkins to reload config.

Global Properties

2012-08-21 Thread Mike Guiney
a new branch I just need to change the property value in the master config.xml and then I can install a new instance of Jenkins somewhere and put this branched config file and job config files and it will just work. I've found 'Global Properties' in the 'Configure system' p