[JIRA] (JENKINS-13904) EnvInject Plugin: option to replace invalid characters in env var names with underscores
[ https://issues.jenkins-ci.org/browse/JENKINS-13904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gregory Boissinot updated JENKINS-13904: Component/s: core (was: envinject) In my opinion, EnvInject plugin has not to be in charge of this concern. EnvInject doesn't have to include logic transformation of environment variables. For now, I change issue component to Jenkins core. 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: core 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
[JIRA] (JENKINS-13904) EnvInject Plugin: option to replace invalid characters in env var names with underscores
[ https://issues.jenkins-ci.org/browse/JENKINS-13904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=163267#comment-163267 ] Chris Fraser commented on JENKINS-13904: I could write a shell script to convert files so the property.names.with.dots are property_names_with_underscores and then inject them via envinject plugin, but since I'd have to do that again and again for each of my jenkins builds, I felt that it would make better sense to have envinject plugin handle this itself. I agree with you that many languages that are in use in Jenkins accept dots as valid chars in variable names, but when I couldn't get the Git plugin to recognize them (Tag ${app.version}.4 does not exist..., when it should be Tag 31.0 does not exist...), then I thought this was a larger issue than simply dealing with unix shells. Since this feature would be optional, I still think it would be nice to allow envinject plugin to process the env var names before exposing them, if the user so desired. 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
[JIRA] (JENKINS-13904) EnvInject Plugin: option to replace invalid characters in env var names with underscores
[ https://issues.jenkins-ci.org/browse/JENKINS-13904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=163217#comment-163217 ] Gregory Boissinot commented on JENKINS-13904: - Shell scripts have a wrong use for Environment variables with dot (.) However, it is not the case for other languges and there are many connectors to other languages with Jenkins. I'm not sure that EnvInject has to be in charge of processing injected environment variables. I'm not completly agree to put processing for the EnvInject. Why not to directly inject the correct environment variables? 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
[JIRA] (JENKINS-13904) EnvInject Plugin: option to replace invalid characters in env var names with underscores
[ https://issues.jenkins-ci.org/browse/JENKINS-13904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on JENKINS-13904 started by Gregory Boissinot. 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
[JIRA] (JENKINS-13904) EnvInject Plugin: option to replace invalid characters in env var names with underscores
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