SetEnvBuildWrapper wrapper = job.getBuildWrappers().get(Jenkins.getInstance().getDescriptorByType(SetEnvBuildWrapper.DescriptorImpl.class))/B
Map<String,String> vars = wrapper.getLocalVarMap()
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/917dbdc6-d11d-4277-87d8-f85468213903%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Something like this I'd guessSetEnvBuildWrapper wrapper = job.getBuildWrappers().get(Jenkins.getInstance().getDescriptorByType(SetEnvBuildWrapper.DescriptorImpl.class))/B
Map<String,String> vars = wrapper.getLocalVarMap()
2017-09-19 20:53 GMT+02:00 Paulo Eduardo Neves <paulo...@gmail.com>:
Earlier today I post this message to Jenkin Users mailing list. I mistakenly though that it were the place for plugin questions. Sorry for the crosspost,
I have a prebuild plugin that extends ParameterDefinition class. It just give me some options to prepare the build.
It is an old installation and uses the deprecated SetEnv plugin to setup a bunch of environment variables.
Is it possible to access the environment variables defined in the SetEnv plugin from my plugin? It just creates the build object when the submit button is pressed, so I don't have access to it from my form.
If I can access the configuration file, I can also parse these variables. Maybe this is easier to do.
I also would like to access the Jenkins global variable values. If I do a System.getenv("JAVA_HOME") I get the value, but if I try with a variable defined in the SetEnv plugin or in the global configuration, it comes null.
If you can point me an example or reference, it would be great.
Thanks in advance for any help.
--
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/917dbdc6-d11d-4277-87d8-f85468213903%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Job job = request.findAncestor(Job.class)
But I don't think there is any good way to get it when constructing the value from CliCommand, maybe the following could workif (command instanceof BuildCommand) {
Job job = (BuildCommand)command.job;
}
/B
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/53457ddc-e051-49a7-846f-7c26b85c8b3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/2hLy525cxsg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS2w6UZ0bBOCaJnLs3rNvSCLbst35KxUUuM62Hom3Az3ug%40mail.gmail.com.