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: > > >

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

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:

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() >

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

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

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,

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 =

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.* import

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 ==

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

2015-01-20 Thread Jonathann Zenou
I seem to have the same issue. Does someone know what to do to alter a global variable from a job ? Is it even possible ? Thanks On Monday, September 29, 2014 at 10:17:57 AM UTC+3, mr wrote: Does anybody have an idea??? Am Dienstag, 23. September 2014 12:03:51 UTC+2 schrieb mr: Thanks

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

2014-09-29 Thread mr
Does anybody have an idea??? Am Dienstag, 23. September 2014 12:03:51 UTC+2 schrieb mr: Thanks for the answer! Where do you inject the username and password? I think you do it into the current build. But I want to inject a new variable or change an existing variable (like e.g. username

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

2014-09-23 Thread mr
Thanks for the answer! Where do you inject the username and password? I think you do it into the current build. But I want to inject a new variable or change an existing variable (like e.g. username or password) into the global configuration, thus next time when I go into the Global Jenkins

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

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)

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, mr -- You received