Unexpanded macro value
I am trying to unexpand the macro value. A macro with this value is parsed and i want to retain its value.
Code:
"BUILD_URL=http://jenkins/job/Test%20New%20NUnit%20Test%20Script/lastBuild" I tried to do it this way without avail. Code:
Option Explicit What i need is the opposite of http://www.kinook.com/Forum/showthread.php?t=1233 |
1 Attachment(s)
What do you mean by 'a macro with this value is parsed'? How was the BUILD_URL macro initialized? Literal % characters in the macro value should be escaped when creating the macro. The vbld_EscapeString system script function can be used for this.
http://www.kinook.com/VisBuildPro/Ma...scriptmisc.htm To assign a macro value to another macro value, just copy the raw value without expanding. See the attached sample. |
The value is parsed as an environment variable when initiated by a jenkins job.
See https://wiki.jenkins-ci.org/display/...nmentVariables The job build command: Code:
VisBuildcmd.exe "BUILD_URL=%BUILD_URL%" /mta /b NUnitTest.bld Code:
VisBuildcmd.exe "BUILD_URL=http://jenkins/job/Test%20New%20NUnit%20Test%20Script/lastBuild" /mta /b NUnitTest.bld Code:
Eg: http://jenkins/job/TestNewNUnitTestScript/ - OK |
1 Attachment(s)
Thanks for the codes, however it still fails with these error:
Code:
Error in Run Script (VBScript) script code at Line 11, Column 1 (http://jenkins/job/Test Code:
http://jenkins/job/Test%20New%20NUnit%20Test%20Script/lastBuild Attachment 1158 |
1 Attachment(s)
Add a step at the beginning of the project to escape the BUILD_URL macro value that was passed in (see attached).
http://www.kinook.com/VisBuildPro/Ma...ecialchars.htm |
Epic. Thanks alot for this!
|
Copy the escaped macro value to another project macro
1 Attachment(s)
Is there any way to copy the escaped macro value BUILD_URL to another project macro BUILD_URL3(not a temp macro)?
In the sample attached I tried to do it with a Set macro step but it did not work -the macro BUILD_URL3 has the unescaped value(The next step log macro fails) |
In a Set Macro action, check the 'Don't expand macros and script' option.
https://kinook.com/VisBuildPro/Manua...acroaction.htm |
Thanks!And if in the Value field there is the macro I do not want expanded and another macro which I want to have it expanded?
|
You can't expand partially. It's all or nothing. Escape (double) something that should not be evaluated as a macro.
|
Thanks.I found another way-I set in the Value field of Set Macro:
[vbld_EscapeString("%BUILD_URL%")] |
All times are GMT -5. The time now is 05:54 PM. |
Copyright © 1999-2023 Kinook Software, Inc.