Have you tried to use ${GIT_BUILD_NUMBER} instead of %GIT_BUILD_NUMBER%?

If you do a SET command in the second Batch command block do you see the 
GIT_BUILD_NUMBER set?

Is it possible to run the commands you need to in the first block where 
GIT_BUILD_NUMBER appears to be working fine?

Thanks
Mark

On Thursday, August 29, 2013 6:44:52 AM UTC-6, TP wrote:
>
> I'm relatively new to the Jenkins world and I'm having issues with the use 
> of environment variables.
>
> I'm currently running builds from code I check out from a git repository. 
> I inject an environment variable called GIT_BUILD_NUMBER that I pull from 
> the checkout and use it successfully in a Windows Batch Command Block:
>
> ::Build Project
> python buildProj.py --branch %Branch% --bin_src %WORKSPACE% --build_number 
> %GIT_BUILD_NUMBER%
>
> This executes successfully with the proper git build number. In the very 
> next "Execute Windows Batch command" block, I simply try to use that same 
> variable in a directory path and this causes the build to fail:
>
> J:\builds\%GIT_BUILD_NUMBER%\
>
> I've also tried this:
>
> J:\\builds\\%GIT_BUILD_NUMBER%\\
>
> When I echo this line, I just get:
>
> J:\builds\\
>
> Any insight would be greatly appreciated.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to