[ 
https://issues.jenkins-ci.org/browse/JENKINS-12809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

pixman20 reopened JENKINS-12809:
--------------------------------


The example I showed was not actually when I noticed the problem.  Our builds 
all started failing when I updated from version 1.17 to 2.23.  When I widdled 
down the config to a very simply config I came up with that example.  
You can simply create temp.config with SOMEVAR=${WORKSPACE} and if WORKSPACE 
has backslashes in it SOMEVAR will end up with no directory separators.  

If you are not able to reproduce this let me know what steps (Workspace name 
and build steps) you are using and I will verify that I still have the issue 
under those circumstances.

Thanks for your help!
                
> Injecting from file removes backslashes on ${WORKSPACE}
> -------------------------------------------------------
>
>                 Key: JENKINS-12809
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-12809
>             Project: Jenkins
>          Issue Type: Bug
>          Components: envinject
>    Affects Versions: current
>         Environment: Windows Server 2003
>            Reporter: pixman20
>            Assignee: gbois
>            Priority: Critical
>
> When using a configuration file, ${WORKSPACE} cannot be used if it contains 
> backslashes.
> Obviously this causes a critical issue on Windows.
> When using the content section it works fine.
> Output shown in the "Injected Environment Variables" Page:
> AAACONTENTVAR D:\jenkins\jobs\TEST_FAIL\workspace
> AAAFILEVAR    D:jenkinsjobsTEST_FAILworkspace
> This behavior can be reproduced by doing the following:
> 1) Add build step "Execute batch script" and add the following content:
>    echo AAAFILEVAR=${WORKSPACE} > temp.config
> 2) Add build step "Inject environment variables" and add to properties file 
> path:
>    temp.config
> 3) Add build step "Inject environment variables" and add to properties 
> content:
>    AAACONTENTVAR=${WORKSPACE}
> 4) Add build step "Execute batch script" and add the following content:
>    @ECHO OFF
>    echo AAAFILEVAR    = %AAAFILEVAR%
>    echo AAACONTENTVAR = %AAACONTENTVAR%
> Console output:
> ------------------------------------------------------------------
> Building on master in workspace D:\jenkins\jobs\TEST_FAIL\workspace
> [workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson6646008055064848449.bat
> D:\jenkins\jobs\TEST_FAIL\workspace>echo AAAFILEVAR=${WORKSPACE}  
> 1>temp.config 
> D:\jenkins\jobs\TEST_FAIL\workspace>exit 0 
> [EnvInject] - Injecting environment variables from a build step.
> [EnvInject] - Injecting as environment variables the properties file path 
> 'temp.config'
> [EnvInject] - Variables injected successfully.
> [EnvInject] - Injecting environment variables from a build step.
> [EnvInject] - Injecting as environment variables the properties content 
> AAACONTENTVAR=${WORKSPACE}
> [EnvInject] - Variables injected successfully.
> [workspace] $ cmd /c call C:\WINDOWS\TEMP\hudson7725197076031217954.bat
> AAAFILEVAR    = D:jenkinsjobsTEST_FAILworkspace
> AAACONTENTVAR = D:\jenkins\jobs\TEST_FAIL\workspace
> Finished: SUCCESS
> ------------------------------------------------------------------

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

        

Reply via email to