Chris Fraser created JENKINS-13904:
--------------------------------------
Summary: EnvInject Plugin: option to replace invalid characters in
env var names with underscores
Key: JENKINS-13904
URL: https://issues.jenkins-ci.org/browse/JENKINS-13904
Project: Jenkins
Issue Type: New Feature
Components: envinject
Reporter: Chris Fraser
Assignee: Gregory Boissinot
Attachments: application.properties, envinject-with-new-option.jpg,
injected-environment-variables.jpg
I've got a Java properties file (example attached), which I don't have the
ability to modify, that I'm sourcing via EnvInject and this file contains keys
which are dot delimited (ex: app.version). EnvInject correctly pulls these in
as I've verified on the "Injected environment variables" screen, but they are
unresolvable when trying to use them in the job.
For instance, when trying to use ${app.version} w/the Git plugin to tag a
build, I get: "Tag ${app.version}.4 does not exist...", and when I try to use
it when executing a shell, I get: "${app.version}: bad substitution". Keys
without dots from this same properties file work just fine... unfortunately I
need access to the ones w/the dots.
After doing a bit of research, I understand why this is happening.
1st of all, you have posted JIRA issues where kohsuke says that env vars w/dots
will not be expanded in Jenkins:
https://issues.jenkins-ci.org/browse/JENKINS-7180
Then, by doing a quick google search, you'll see that dots in env vars are not
supported in most shells and people say to just stay away from them.
With that in mind, I think a great feature to add to the EnvInject plugin would
be to give users the option to replace the dots (and actually any other which
are invalid in env var names) that appear in environment variable names with an
underscore. If you look at this issue that was opened against the SharedObjects
plugin, you'll see that, "...environment variables from tool names replaces a
space, a
dash or a dot to by a underscore."
https://issues.jenkins-ci.org/browse/JENKINS-13673
Please see attached properties files and screenshots.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira